fedipage/static/sw.js
Jeffrey Phillips Freeman 1afe272ca0
initial commit
2023-10-08 01:35:17 -04:00

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();
});