Skip to content

Instantly share code, notes, and snippets.

@ankitamasand
Created August 12, 2018 05:50
Show Gist options
  • Save ankitamasand/164b8d6657654c16e9ea4fb54bf18c8c to your computer and use it in GitHub Desktop.
Save ankitamasand/164b8d6657654c16e9ea4fb54bf18c8c to your computer and use it in GitHub Desktop.
self.addEventListener('activate', (event) => {
event.waitUntil(
self.clients.matchAll().then ( (client) => {
client.postMessage({
msg: 'Hey, from service worker! I\'m listening to your fetch requests.',
source: 'service-worker'
})
})
)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment