Published at
Updated at
Reading time
1min

Today I saw a quick Twitter conversation about service workers. The question was how to uninstall all registered service workers in Chrome.

It turns out that there is one Chrome-specific URL that shows all installed Service Workers – chrome://serviceworker-internals/. It lists service worker internals such as installation status, the running script and the service worker scope.

Scope: https://twitter.com/
Registration ID: 0 (unregistered)
Navigation preload enabled: false
Navigation preload header length: 4
Active worker:
Installation Status: ACTIVATED
Running Status: RUNNING
Fetch handler existence: EXISTS
Script: https://twitter.com/sw.js
Version ID: 111
Renderer process ID: 68693
Renderer thread ID: 19
DevTools agent route ID: 52
Client:
ID: fcf2a23e-9af3-4001-b196-c942340be16a
URL: https://twitter.com/stefanjudis

The page also includes actions for every service worker including an unregister one.

To avoid clicking all the button manually, you can inspect the markup and quickly run a single JS command in the console to get rid of them all.

// Note that the HTML of the internal Service Worker page could change.
// 
// If the following snippet doesn't work, inspect the HTML and 
// adjust it to select the right buttons to click.
$$('[data-command="unregister"]').forEach(b => b.click())

It's good to know that this page exists. :)

Overview of internal Service Worker page showing how to select the correct button and run a command in the JS console.

If you enjoyed this article...

Join 6.3k readers and learn something new every week with Web Weekly.

Reply to this post and share your thoughts via good old email.
Stefan standing in the park in front of a green background

About Stefan Judis

Frontend nerd with over ten years of experience, freelance dev, "Today I Learned" blogger, conference speaker, and Open Source maintainer.

Related Topics

Related Articles