Chrome og Firefox give brugerne muligheder for at administrere registrerede Servicearbejdere i browseren, herunder muligheder for at fjerne Servicearbejdere fra browseren.
Service Workers are an up and coming feature supported by most modern browsers that enable sites and services to interact with the browser without having to be open in it.
Web browsers are not designed currently to prompt users all the time when Service Workers are registered in the browser. This happens as a background process most of the time currently.
Manage Service Workers
The Service Worker is registered either automatically, or after the user accepts a prompt. Pinterest is a website that registers one automatically when the site is visited in Chrome or Firefox.
This is not made clear to the user as it happens in the background.
Chrome and Firefox offer no clear information on how to manage Service Workers that were added to the browser previously. While capabilities exist, they are more or less hidden from users at this point in time which is problematic if previously registered workers need to be removed from the browser.
This guide provides you with the means to manage workers in Firefox and Chrome.
- Origin is the page the Service Worker was registered from.
- Scope refers to the pages that the Service Worker controls (accepts fetch and message events from).
Manage Service Workers in Mozilla Firefox
Firefox users can manage all registered Service Workers in the browser in the following way:
- Load about:serviceworkers in a new tab or the current tab, for instance by copying and pasting the address or bookmarking it and loading it this way.
- Firefox displays all registered Service Workers on the page. Each Service Worker is listed with its origin, scope, current worker URL, cache name and other information.
- Click on unregister to remove the Service Worker from Firefox, or update to request an update from its source.
Disable Service Workers in Mozilla Firefox
Firefox users can disable Service Workers in the browser in the following way (via our extensive list of Firefox privacy and security settings guide):
- Load about:config in the browser's address bar and hit enter.
- Confirm that you will be careful if a notification is displayed.
- Use the search field to find dom.service
- Locate dom.serviceWorkers.enabled and double-click on the preference name to set it to false. Doing so disables the Service Workers functionality in Mozilla Firefox.
To undo the change, repeat the process but make sure that the value of the preference is set to true when you are done.
Manage Service Workers in Google Chrome
- You need to load the url chrome://serviceworker-internals/ in the Chrome web browser to open the list of registered workers.
- Chrome displays slightly different information than Firefox, including a console log which may come in handy.
- Hit the unregister button to remove the selected item from the browser, or start to activate it.
Disable Service Workers in Google Chrome
There does not seem to be a way currently to disable the feature in the Chrome browser. Leave a comment below if you have found a way, and I'll update the article asap.
The following resources offer additional -- usually focused on development -- resources.
- Get Started with Service Worker Google Developers
- Is Service Worker Ready compares browser support
- Service Worker API MDN
- Service Worker Introduction on HTML5 Rocks
- The W3C Service Workers Working Draft