blob: 0cf97fe23f8cca06212232eef99eea6757715621 [file] [log] [blame]
async function doTest(event)
{
if (event.data === "SET-FETCH") {
self.receivedFetch = 0;
self.addEventListener("fetch", (event) => {
self.receivedFetch++;
});
event.source.postMessage("OK");
return;
}
if (event.data === "GET-FETCH") {
event.source.postMessage(self.receivedFetch);
return;
}
event.source.postMessage("KO");
}
self.addEventListener("message", doTest);