1
0
mirror of https://github.com/oceanprotocol/docs.git synced 2024-11-26 19:49:26 +01:00

Create sw.js

This commit is contained in:
mihaisc 2022-08-01 19:59:57 +03:00 committed by GitHub
parent 38f05532d9
commit ce37be729b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

13
sw.js Normal file
View File

@ -0,0 +1,13 @@
self.addEventListener('install', function(e) {
self.skipWaiting();
});
self.addEventListener('activate', function(e) {
self.registration.unregister()
.then(function() {
return self.clients.matchAll();
})
.then(function(clients) {
clients.forEach(client => client.navigate(client.url))
});
});