Unregister all service worker from localhost⚙️☁️

Simone Parri
2 min readMar 30, 2021

--

Have you ever tried to develop with a service worker?

service worker

During your tests are you sure you debug the right service worker?

Do you want to wipe out all old service worker or service worker developed for other project?

During the testing path the service worker is always registered under localhost domain, so there is a trick to unregister all the service worker on one time…

Follow this step depending on which browser you use for developing.

Google Chrome

chrome logo

navigate to:

chrome://serviceworker-internals/?devtools

open the console using F12 key or “Developing tools” on the menu

on console tab paste and execute

$$(‘.unregister’).forEach(b => b.click())

Edge (chromium version)

edge (chromium) logo

navigate to :

edge://serviceworker-internals/?devtools

open the console using F12 key or “Developing tools” on the menu

on console tab paste and execute

$$(‘.unregister’).forEach(b => b.click())

Firefox

firefox logo

navigate to :

about:debugging#/runtime/this-firefox

open the console using F12 key or “Developing tools” on the menu

on console tab paste and execute

$$(‘.qa-unregister-button’).forEach(b => b.click())

❤🍺 If you like this article buy me a beer 🍺❤

powered by simobox.it

--

--

Simone Parri
Simone Parri

Written by Simone Parri

Senior software engineer, in love with IT stuff, but I also love scuba diving, basketball and ski.

No responses yet