1
0
mirror of https://github.com/comatory/fb2iCal synced 2025-01-29 08:29:25 +01:00

32 lines
622 B
JavaScript
Raw Normal View History

// Worker v10
2019-10-20 20:32:25 +02:00
self.addEventListener('install', (event) => {
event.waitUntil(
caches.open('fb-to-ical').then((cache) => {
return cache.addAll([
'/',
'/favicon.ico',
'/scripts.js?5',
'/style.css?6',
2019-10-24 20:45:34 +02:00
'/about?2',
2019-10-24 21:29:28 +02:00
'/icon-512.png',
2019-10-20 20:32:25 +02:00
])
})
)
})
self.addEventListener('fetch', (event) => {
event.respondWith(
caches.match(event.request)
.then((response) => {
return response || fetch(event.request)
})
)
})
self.addEventListener('message', (event) => {
if (event.data.action === 'skipWaiting') {
self.skipWaiting()
}
})