blob: a5c1e78f2f0ef4d364900a1941dc41cd8d458f7d [file] [log] [blame]
async function doTest(event)
{
if (event.preloadResponse) {
event.respondWith(event.preloadResponse.then((response) => {
if (event.request.url.includes("get-body")) {
const clone = response.clone();
clone.body.getReader();
return response;
}
if (self.internals)
setTimeout(() => internals.terminate(), 0);
return response;
}));
return;
}
event.respondWith(fetch(event.request));
}
self.addEventListener("fetch", doTest);