1
0
mirror of https://github.com/comatory/fb2iCal synced 2024-12-28 17:30:51 +01:00
Facebook-Events-iCal-Converter/lib/public/service-worker.js
2019-10-20 20:32:25 +02:00

20 lines
391 B
JavaScript

self.addEventListener('install', (event) => {
event.waitUntil(
caches.open('fb-to-ical').then((cache) => {
return cache.addAll([
'/',
'/favicon.ico',
])
})
)
})
self.addEventListener('fetch', (event) => {
event.respondWith(
caches.match(event.request)
.then((response) => {
return response || fetch(event.request)
})
)
})