mirror of
https://github.com/kremalicious/portfolio.git
synced 2024-12-22 09:13:19 +01:00
14 lines
333 B
JavaScript
14 lines
333 B
JavaScript
// https://github.com/NekR/self-destroying-sw
|
|
self.addEventListener('install', (e) => {
|
|
self.skipWaiting()
|
|
})
|
|
|
|
self.addEventListener('activate', (e) => {
|
|
self.registration
|
|
.unregister()
|
|
.then(() => self.clients.matchAll())
|
|
.then((clients) => {
|
|
clients.forEach((client) => client.navigate(client.url))
|
|
})
|
|
})
|