mtgcsv/service-worker.js

23 lines
573 B
JavaScript
Raw Normal View History

2024-08-21 03:23:06 +02:00
self.addEventListener('install', (event) => {
event.waitUntil(
caches.open('mtg-csv-generator-v1').then((cache) => {
return cache.addAll([
'/',
'/index.html',
'/styles.css',
'/app.js',
'/manifest.json',
'/icon.png'
]);
})
);
});
self.addEventListener('fetch', (event) => {
event.respondWith(
caches.match(event.request).then((response) => {
return response || fetch(event.request);
})
);
});