DEV Community

wusher
wusher

Posted on • Originally published at wusher.github.io on

Unregister Service Workers

A little bit of code to unregister all service workers:

if (navigator.serviceWorker) {
  navigator.serviceWorker.getRegistrations().then(function (registrations) {
    for (let registration of registrations) {
      registration.unregister();
    }
  });
}

Enter fullscreen mode Exit fullscreen mode

Top comments (0)