2022-08-01 18:59:57 +02:00
|
|
|
self.addEventListener('install', function(e) {
|
|
|
|
self.skipWaiting();
|
|
|
|
});
|
|
|
|
|
2022-08-02 13:12:52 +02:00
|
|
|
self.addEventListener("activate", function (event) {
|
|
|
|
event.waitUntil(
|
|
|
|
caches.keys().then(function (cacheNames) {
|
|
|
|
return Promise.all(
|
|
|
|
cacheNames
|
|
|
|
.filter(function (cacheName) {
|
|
|
|
// Return true if you want to remove this cache,
|
|
|
|
// but remember that caches are shared across
|
|
|
|
// the whole origin
|
|
|
|
})
|
|
|
|
.map(function (cacheName) {
|
|
|
|
return caches.delete(cacheName);
|
|
|
|
})
|
|
|
|
);
|
|
|
|
})
|
|
|
|
);
|
|
|
|
self.registration.unregister()
|
2022-08-01 18:59:57 +02:00
|
|
|
.then(function() {
|
|
|
|
return self.clients.matchAll();
|
|
|
|
})
|
|
|
|
.then(function(clients) {
|
|
|
|
clients.forEach(client => client.navigate(client.url))
|
|
|
|
});
|
|
|
|
});
|