1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-11-22 09:56:51 +01:00
blog/public/sw.js

15 lines
304 B
JavaScript
Raw Normal View History

self.addEventListener('install', () => {
2022-11-20 15:51:22 +01:00
self.skipWaiting()
})
self.addEventListener('activate', () => {
2022-11-20 15:51:22 +01:00
self.registration
.unregister()
.then(() => self.clients.matchAll())
.then((clients) => {
for (const client of clients) {
client.navigate(client.url)
}
2022-11-20 15:51:22 +01:00
})
})