2019-11-14 09:24:55 +01:00
|
|
|
// Worker v13
|
2019-10-20 22:29:00 +02:00
|
|
|
|
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',
|
2019-11-10 16:35:54 +01:00
|
|
|
'/scripts.js?5',
|
2019-11-14 09:24:55 +01:00
|
|
|
'/style.css?8',
|
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)
|
|
|
|
})
|
|
|
|
)
|
|
|
|
})
|
2019-10-20 22:29:00 +02:00
|
|
|
|
|
|
|
self.addEventListener('message', (event) => {
|
|
|
|
if (event.data.action === 'skipWaiting') {
|
|
|
|
self.skipWaiting()
|
|
|
|
}
|
|
|
|
})
|