diff --git a/static/service-worker.js b/static/service-worker.js index 1c55eb8..8d68c57 100644 --- a/static/service-worker.js +++ b/static/service-worker.js @@ -1,6 +1,7 @@ const CACHE_VERSION = 'v13'; const CACHE_NAME = `e621tagger-${CACHE_VERSION}`; const STATIC_CACHE = `${CACHE_NAME}-static`; + const urlsToCache = [ '/', '/static/css/style.css', @@ -43,22 +44,14 @@ self.addEventListener('activate', event => { } }) ); - }).then(() => { - return clients.claim(); - }).then(() => { - clients.matchAll({ type: 'window' }).then(clients => { - clients.forEach(client => { - client.postMessage({ action: 'reload' }); - }); - }); - }) + }).then(() => clients.claim()) ); }); self.addEventListener('fetch', event => { const url = new URL(event.request.url); - const isStatic = url.pathname.startsWith('/static/') || - url.pathname === '/favicon.ico' || + const isStatic = url.pathname.startsWith('/static/') || + url.pathname === '/favicon.ico' || url.pathname === '/manifest.json'; if (event.request.method !== 'GET') {