feat(pwa): installable — PNG icons + beforeinstallprompt button
Chrome's install prompt needs 192 and 512 PNG icons (SVG-only often isn't enough, especially on Android). Add them and reference them in the manifest (any + maskable). offline.js captures beforeinstallprompt and shows an 'Installér app' button that triggers the native prompt, and clears it on appinstalled. Bump SW cache to v2 so the new manifest/icons take effect.
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
// citti service worker — offline shell + asset caching.
|
||||
// Pages: network-first (fresh when online, cached copy in the store).
|
||||
// Assets: cache-first. POSTs are never touched here — the page queues them.
|
||||
const CACHE = 'citti-v1';
|
||||
const CORE = ['/', '/tilbud', '/koeb-nu', '/offline.js', '/manifest.webmanifest', '/icon.svg'];
|
||||
const CACHE = 'citti-v2';
|
||||
const CORE = ['/', '/tilbud', '/koeb-nu', '/offline.js', '/manifest.webmanifest',
|
||||
'/icon.svg', '/static/icon-192.png', '/static/icon-512.png'];
|
||||
|
||||
self.addEventListener('install', (e) => {
|
||||
e.waitUntil(
|
||||
|
||||
Reference in New Issue
Block a user