owlboard-svelte/static/sw.js

18 lines
511 B
JavaScript
Raw Normal View History

// Remove the service worker /sw.js from legacy installations
// This should then enable the new /service-worker.js to be installed
self.addEventListener('activate', function (e) {
2023-07-12 21:00:28 +01:00
console.log(`Unregistering service worker`);
self.registration
.unregister()
.then(function () {
return self.clients.matchAll();
})
.then(function (clients) {
2023-07-12 21:00:28 +01:00
clients.forEach((client) => {
console.log(`Navigating ${client.url}`);
client.navigate(client.url);
});
});
2023-07-12 21:00:28 +01:00
});