blob: c35269924be92d9d2be54517af588654fe3e07bf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
self.skipWaiting();
addEventListener("fetch", event => {
const url = new URL(event.request.url);
const params = new URLSearchParams(url.search);
if (params.get("clone") === "1") {
event.respondWith(fetch(event.request.clone()));
} else {
event.respondWith(fetch(event.request));
}
});
addEventListener("activate", function(event) {
event.waitUntil(clients.claim());
});
|