Skip to content

Instantly share code, notes, and snippets.

@BookGin
Last active March 24, 2026 10:16
Show Gist options
  • Select an option

  • Save BookGin/4e6cc407ba979f7a8f4f43485009d359 to your computer and use it in GitHub Desktop.

Select an option

Save BookGin/4e6cc407ba979f7a8f4f43485009d359 to your computer and use it in GitHub Desktop.
Unregister all service workers in Firefox.
# navigate to about:debugging#workers first
for (let k of document.getElementsByClassName("unregister-link")) k.click()
for (let k of document.getElementsByClassName("qa-unregister-button")) k.click()
@slater
Copy link
Copy Markdown

slater commented Oct 18, 2020

they changed the className, at least in Firefox 81, now should be:

for (let k of document.getElementsByClassName("qa-unregister-button")) k.click()

@BookGin
Copy link
Copy Markdown
Author

BookGin commented Oct 19, 2020

they changed the className, at least in Firefox 81, now should be:

for (let k of document.getElementsByClassName("qa-unregister-button")) k.click()

I've updated the code snippet. Thank you!

@idanoo
Copy link
Copy Markdown

idanoo commented Apr 19, 2021

I had to update it to the following to work for me on FF 87.0

for (let k of document.querySelectorAll('[data-l10n-id="unregister-button"]')) k.click()

@kkm000
Copy link
Copy Markdown

kkm000 commented May 23, 2022

Thanks! This did it for me (FF 101.0b9, Developer Edition):

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

@t0b1hh
Copy link
Copy Markdown

t0b1hh commented Feb 22, 2026

FF 143.0.3 (aarch64)

URL: about:serviceworkers

document.querySelectorAll('#serviceworkers>div button[data-l10n-id="unregister-button"]').forEach(btn=> btn.click() )

@influential-eliot
Copy link
Copy Markdown

To quote an ancient UK advertisement for tea, this is the TAYST! πŸͺ‡ πŸ’ƒ

FF 143.0.3 (aarch64)
URL: about:serviceworkers

document.querySelectorAll('#serviceworkers>div button[data-l10n-id="unregister-button"]').forEach(btn=> btn.click() )

It also works in 148.0.2 (64-bit) (mozilla-deb from


Here it is in bookmarklet form, if you want to make a button for it:

javascript:(function(){document.querySelectorAll('#serviceworkers>div button[data-l10n-id="unregister-button"]').forEach(btn=> btn.click() )})();

Just add a new bookmark and paste that into the URL field. πŸ‘
Heck, you could probably add a couple of lines to open the page, then prompt you you OK the process. 😲

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment