Created
April 3, 2025 21:53
-
-
Save paul-millar/5fbe5b84399a88c1191449bf124f32c7 to your computer and use it in GitHub Desktop.
sw.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment