mirror of
https://github.com/Fenrir784/e621tagger.git
synced 2026-12-03 23:22:25 -08:00
Update service-worker.js
This commit is contained in:
1 parent
d28a1c34be
commit
134453ae11
1 file changed
+4
-11
@@ -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') {
|
||||
|
||||
Reference in new issue
Block a user