fix: restore service worker and add manifest icons

This commit is contained in:
Linus Rath
2026-04-09 22:19:56 +02:00
parent 9c5daa3918
commit 790d7084af
5 changed files with 7 additions and 17 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

+7 -17
View File
@@ -1,26 +1,16 @@
/* eslint-disable no-undef */ /* eslint-disable no-undef */
// Self-destructing service worker. // Minimal service worker satisfies the PWA installability requirement
// // without caching any assets. All requests fall through to the network,
// The previous version of this file used a cache-first strategy with no // so there is no risk of serving stale chunks after a deployment.
// dev-mode guard, which pinned stale JS/HTML chunks until a hard reload.
// This replacement unregisters itself and wipes all caches as soon as the
// browser picks it up. Browsers re-fetch sw.js on every navigation to check
// for updates, so any client running the old worker will swap to this one
// on their next page load and then lose the worker entirely.
self.addEventListener("install", () => { self.addEventListener("install", () => {
self.skipWaiting(); self.skipWaiting();
}); });
self.addEventListener("activate", (event) => { self.addEventListener("activate", (event) => {
event.waitUntil( event.waitUntil(self.clients.claim());
(async () => {
const cacheNames = await caches.keys();
await Promise.all(cacheNames.map((name) => caches.delete(name)));
await self.registration.unregister();
const clients = await self.clients.matchAll({ type: "window" });
clients.forEach((client) => client.navigate(client.url));
})(),
);
}); });
// Network-only fetch handler no caching.
self.addEventListener("fetch", () => {});