Created
August 10, 2019 15:46
-
-
Save prateekbh/597299c4c13f69c543ca013249124d48 to your computer and use it in GitHub Desktop.
This file contains 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', event => { | |
self.skipWaiting(); | |
}); | |
self.addEventListener('activate', async event => { | |
await clients.claim(); | |
const windowClients = await clients.matchAll({ type: 'window' }); | |
windowClients.forEach( | |
(client) => | |
client.navigate(client.url), | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment