This commit is contained in:
sion
2026-03-26 01:35:51 +08:00
parent 396b81d6d9
commit 54178e196e
147 changed files with 9 additions and 212431 deletions

View File

@@ -1,31 +0,0 @@
'use strict';
self.addEventListener('install', () => {
self.skipWaiting();
});
self.addEventListener('activate', (event) => {
event.waitUntil(
(async () => {
try {
await self.registration.unregister();
} catch (e) {
console.warn('Failed to unregister the service worker:', e);
}
try {
const clients = await self.clients.matchAll({
type: 'window',
});
// Reload clients to ensure they are not using the old service worker.
clients.forEach((client) => {
if (client.url && 'navigate' in client) {
client.navigate(client.url);
}
});
} catch (e) {
console.warn('Failed to navigate some service worker clients:', e);
}
})()
);
});