Create a gist now

Instantly share code, notes, and snippets.

@inian /unregister.js
Last active Jan 27, 2017

What would you like to do?
Unregister all SW registrations
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