This is the last time we let Pasha commit ascii porn in the comments.

This commit is contained in:
Frank Schwenk
2025-05-15 14:35:39 +02:00
parent a34405268a
commit f04b425217
5 changed files with 62 additions and 0 deletions

31
service-worker.js Normal file
View File

@@ -0,0 +1,31 @@
const CACHE_NAME = 'bscscore-v1';
const URLS_TO_CACHE = [
'/',
'/index.html',
'/manifest.json',
'/favicon.ico',
'/icon-192.png',
'/icon-512.png'
];
self.addEventListener('install', event => {
event.waitUntil(
caches.open(CACHE_NAME).then(cache => cache.addAll(URLS_TO_CACHE))
);
});
self.addEventListener('activate', event => {
event.waitUntil(
caches.keys().then(keys =>
Promise.all(keys.filter(key => key !== CACHE_NAME).map(key => caches.delete(key)))
)
);
});
self.addEventListener('fetch', event => {
event.respondWith(
caches.match(event.request).then(response =>
response || fetch(event.request).catch(() => caches.match('/index.html'))
)
);
});