feat: add service worker route with cache-control headers and update PWA manifest icons for proper maskable support
Add /sw.js route with send_from_directory to serve service worker from root scope with Service-Worker-Allowed:/ and Cache-Control:no-cache headers. Add navigator.serviceWorker.register() script to index.html with load event listener and scope:/ parameter. Update service worker cache to v4 with media-mark-192.svg/media-mark-512.svg additions to SHELL array. Update manifest.json icons
This commit is contained in:
+2
-2
@@ -1,5 +1,5 @@
|
||||
const CACHE_NAME = 'media-max-shell-v3';
|
||||
const SHELL = ['/static/media-mark.svg', '/static/manifest.json'];
|
||||
const CACHE_NAME = 'media-max-shell-v4';
|
||||
const SHELL = ['/static/media-mark.svg', '/static/media-mark-192.svg', '/static/media-mark-512.svg', '/static/manifest.json'];
|
||||
|
||||
self.addEventListener('install', event => {
|
||||
event.waitUntil(caches.open(CACHE_NAME).then(cache => cache.addAll(SHELL)));
|
||||
|
||||
Reference in New Issue
Block a user