match fedibird's SW

This commit is contained in:
FloatingGhost 2022-12-08 14:59:06 +00:00
parent 2358754bb3
commit 702f82cb04

View file

@ -68,19 +68,8 @@ self.addEventListener('activate', function(event) {
self.addEventListener('fetch', function(event) {
const url = new URL(event.request.url);
const asyncResponse = fetch(event.request);
const asyncCache = openWebCache();
event.respondWith(asyncResponse.then(response => {
if (response.ok || response.type === 'opaqueredirect') {
return Promise.all([
asyncCache.then(cache => cache.delete('/web')),
indexedDB.deleteDatabase('mastodon'),
]).then(() => response);
}
return response;
}));
if (url.pathname.startsWith('/web')) {
return;
}
});