1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-11-24 19:04:08 +01:00
blog/public/sw.js

15 lines
330 B
JavaScript
Raw Normal View History

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