Skip to main

Unregister all Service Workers

  • serviceworker
  • javascript
1 min read
if ("serviceWorker" in navigator) {
  navigator.serviceWorker.getRegistrations().then(function (registrations) {
    for (let registration of registrations) {
      registration.unregister();
    }
  });
}