Skip to content

Instantly share code, notes, and snippets.

@kloudsamurai
Created January 30, 2019 08:13
Show Gist options
  • Select an option

  • Save kloudsamurai/0f4b48108babd0f706bd90f7205a9a36 to your computer and use it in GitHub Desktop.

Select an option

Save kloudsamurai/0f4b48108babd0f706bd90f7205a9a36 to your computer and use it in GitHub Desktop.
Remove all installed service workers
if (typeof window !== 'undefined' && 'serviceWorker' in navigator) {
window.navigator.serviceWorker.getRegistrations().then(registrations => {
registrations.forEach(r => r.unregister())
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment