Skip to content

Instantly share code, notes, and snippets.

@mrenty
Created October 27, 2017 06:55
Show Gist options
  • Save mrenty/b25227596e27b2a030878e6912422471 to your computer and use it in GitHub Desktop.
Save mrenty/b25227596e27b2a030878e6912422471 to your computer and use it in GitHub Desktop.
if (SERVICE_WORKER_KILL_SWITCH && 'serviceWorker' in navigator && /https/.test(location.protocol)) {
navigator.serviceWorker.getRegistrations().then(registration => {
for (let registration of registrations) {
registration.unregister();
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment