Update service-worker.js

This commit is contained in:
Fenrir784 authored and GitHub committed 2026-03-23 22:38:55 +03:00
1 parent d28a1c34be
commit 134453ae11
1 file changed
+4 -11
+4 -11
View File
@@ -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') {