mirror of
https://git.qoto.org/fedipage/fedipage.git
synced 2024-11-17 07:48:21 +01:00
18 lines
367 B
JavaScript
18 lines
367 B
JavaScript
function killSW() {
|
|
self.registration.unregister();
|
|
|
|
caches
|
|
.keys()
|
|
.then((cacheKeys) =>
|
|
Promise.all(cacheKeys.map((key) => caches.delete(key)))
|
|
);
|
|
}
|
|
|
|
self.addEventListener("install", (event) => {
|
|
event.waitUntil(self.skipWaiting());
|
|
});
|
|
|
|
self.addEventListener("activate", (event) => {
|
|
event.waitUntil(self.clients.claim());
|
|
killSW();
|
|
});
|