1
0
mirror of https://github.com/oceanprotocol/docs.git synced 2024-11-26 19:49:26 +01:00
docs/sw.js
2022-08-02 11:34:07 +03:00

16 lines
391 B
JavaScript

self.addEventListener('install', function(e) {
console.log('script install')
self.skipWaiting();
});
self.addEventListener('activate', function(e) {
console.log('script activate')
self.registration.unregister()
.then(function() {
return self.clients.matchAll();
})
.then(function(clients) {
clients.forEach(client => client.navigate(client.url))
});
});