This commit is contained in:
2026-08-20 18:44:46 -05:00
parent 5a54e50882
commit dbe0ce8af2
16 changed files with 3002 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
const CACHE_NAME = 'sulfur-cache-v3';
const urlsToCache = [
'./index.html',
'./css/style.css',
'./js/launcher.js',
'./manifest.json',
'./instances/sulfur.html',
'./assets/icon-192.png',
'./assets/icon-512.png',
'./assets/favicon.png',
'./assets/bg-atm10.jpg',
'./assets/bg-vanilla8.jpg',
'./assets/thumb-atm10.png',
'./assets/thumb-vanilla8.png'
];
self.addEventListener('install', event => {
self.skipWaiting();
event.waitUntil(
caches.open(CACHE_NAME).then(cache => cache.addAll(urlsToCache))
);
});
self.addEventListener('activate', event => {
event.waitUntil(
caches.keys().then(keys =>
Promise.all(keys.filter(k => k !== CACHE_NAME).map(k => caches.delete(k)))
)
);
self.clients.claim();
});
self.addEventListener('fetch', event => {
event.respondWith(
caches.match(event.request).then(response => response || fetch(event.request))
);
});