mirror of
https://github.com/YunoHost-Apps/keeweb_ynh.git
synced 2024-09-03 19:26:33 +02:00
20 lines
503 B
JavaScript
20 lines
503 B
JavaScript
|
const VERSION = '1.18.7';
|
||
|
|
||
|
self.addEventListener('install', (event) =>
|
||
|
event.waitUntil(
|
||
|
caches.open('v1').then((cache) =>
|
||
|
fetch('.?v=' + VERSION).then((response) => {
|
||
|
if (response.ok) {
|
||
|
return cache.put('.', response);
|
||
|
}
|
||
|
})
|
||
|
)
|
||
|
)
|
||
|
);
|
||
|
|
||
|
self.addEventListener('fetch', (event) => {
|
||
|
event.respondWith(
|
||
|
caches.match(event.request.url).then((response) => response || fetch(event.request))
|
||
|
);
|
||
|
});
|