-
-
Save r17x/822dd75f8c42c4b0b8e141aaef50b1e7 to your computer and use it in GitHub Desktop.
Unregister all SW registrations
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
try { | |
navigator.serviceWorker.getRegistrations().then(function(registrations) { | |
registrations.forEach(function(registration) { | |
console.log('removing registration', registration); | |
registration.unregister(); | |
}) | |
}) | |
} | |
catch (e) { | |
console.log('failed to unregister all service workers', e); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment