Manage Service Workers in Firefox and Chrome - gHacks Tech News

Manage Service Workers in Firefox and Chrome

Chrome and Firefox provide users with options to manage registered Service Workers in the browser, including options to remove Service Workers from the browser.

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.

Think of them as on-demand processes that enable the use of push notifications and data synchronization, or make sites work offline.

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

show notifications

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.

Useful information

  • 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).
  • Script lists the url of the Service Worker JavaScript file.

Manage Service Workers in Mozilla Firefox

firefox manage service workers

Firefox users can manage all registered Service Workers in the browser in the following way:

  1. 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.
  2. 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.
  3. 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 disable service workers

Firefox users can disable Service Workers in the browser in the following way (via our extensive list of Firefox privacy and security settings guide):

  1. Load about:config in the browser's address bar and hit enter.
  2. Confirm that you will be careful if a notification is displayed.
  3. Use the search field to find dom.service
  4. 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

chrome service workers

  1. You need to load the url chrome://serviceworker-internals/ in the Chrome web browser to open the list of registered workers.
  2. Chrome displays slightly different information than Firefox, including a console log which may come in handy.
  3. 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.

Useful Resources

The following resources offer additional -- usually focused on development -- resources.

Summary
Manage Service Workers in Firefox and Chrome
Article Name
Manage Service Workers in Firefox and Chrome
Description
Find out how to manage Service Workers in the Firefox and Google Chrome web browser, and how to turn them off.
Author
Publisher
Ghacks Technology News
Logo




  • We need your help

    Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.

    We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats (video ads) or subscription fees.

    If you like our content, and would like to help, please consider making a contribution:

    Comments

    1. Maelish said on March 2, 2016 at 2:53 pm
      Reply

      As a web developer with a tabletop gaming player finder website that relies on communication with it’s members, I find the idea of agents to be fascinating. It is very tantalizing.

      But as an end-user it terrifies me because of the vast number of ways it can be misused. Aside from annoying pop-ups every time somebody has a notification for you, how long will it be until somebody figures out how to push an install package down the pipe to you.

      1. Maelish said on March 2, 2016 at 3:04 pm
        Reply

        I’ve found several service workers in my local Chrome install. None of them actually did push notifications, they all had other functions.

        Something to note: Service Workers only work on https pages.

    2. eduardo cardio said on March 2, 2016 at 2:58 pm
      Reply

      Martin said:

      “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.”

      If you click the ‘unregister’ button, the service work is removed.

      1. Martin Brinkmann said on March 2, 2016 at 3:00 pm
        Reply

        Eduardo, yes you can remove Service Workers once they are registered, but there seems to be no way to disable the entire feature like it is possible in Firefox.

        1. Maelish said on March 2, 2016 at 3:06 pm
          Reply

          I expect a new class of blockables in uBlock Origin will show up soon just for these types of files.

        2. Sören Hentzschel said on March 2, 2016 at 4:17 pm
          Reply

          I dont’t think that a preference to disable Service Workers is really needed. It’s a web standard and probably one of the most important new web standards for the next years. Firefox needs a preference because Service Workers are enabled in Firefox 44 and will be disabled in Firefox ESR 45 because of upcoming spec and implementation changes. In the long term I don’t see any reason to keep the preference.

          (But it’s only my opinion and I don’t know of plans to remove the preference)

        3. Anonymous said on December 21, 2017 at 9:04 pm
          Reply

          @ Sören Hentzschel – There HAVE TO BE rhe preference to turn this feature off and disable it completely. I hate the spam notifications and I want the option.

        4. Sören Hentzschel said on December 21, 2017 at 11:01 pm
          Reply

          @Anonymous: You didn’t understand my comment / what service sorkers are. Service worker is *not* a synonym for notifications. Notifications are only a part and there *is* a preference to disable notifications *without* disabling the full service workers standard.

        5. Anonymous said on December 22, 2017 at 8:53 pm
          Reply

          @ Sören Hentzschel – Maybe, but Service Workers are the problem for security and privacy. There is little documentation about them. They install silently in background without any notification. They run silently in background. They intercept network traffic. They can come from any website. They don’t need originating website open to be running. What’s more there are still unknown security implications. In past it was: CVE-2016-5259, CVE-2016-2812, CVE-2016-1949, CVE-2016-5287. They improve tracking and targeting. What’s more they could be even used as botnet – https://sakurity.com/blog/2016/12/10/serviceworker_botnet.html

    3. Mike J. said on March 2, 2016 at 4:56 pm
      Reply

      Why would anyone want this? Sounds much worse than cookies to me.

      1. Sören Hentzschel said on March 2, 2016 at 5:05 pm
        Reply

        Can you explain your comment? Service Workers and Cookies are totally different things.

        1. Mike J. said on March 2, 2016 at 5:16 pm
          Reply

          Allowing sites to converse with your browser?? Seems a major invasion of privacy. I have yet to read what good it does for the user….Please note, I am very ignorant about most things Internet-related, which is why I come here–to learn.

        2. Sören Hentzschel said on March 2, 2016 at 5:23 pm
          Reply

          There is a website from Mozilla:
          serviceworke.rs

          … where you can find examples what is possible with service workers. Cookies are just a storage. ;)

    4. Mike J. said on March 2, 2016 at 6:27 pm
      Reply

      Mr. Hentzschel , pardon my asking, but are you a website developer??

      1. Sören Hentzschel said on March 2, 2016 at 6:40 pm
        Reply

        Yes. That’s my job. ;-)

    5. Tom Hawack said on March 2, 2016 at 6:56 pm
      Reply

      When I exit from a site (a domain) it is not to have it stick to my browser session afterwards.
      Consequently, in conformity with Pants’ work published here at ‘Ghacks user.js Firefox privacy and security list’ :

      // disable service workers
      user_pref(“dom.serviceWorkers.enabled”, false);
      // disable push notifications – push requires serviceWorkers to be enabled – I push on double-locking!
      user_pref(“dom.push.enabled”, false);
      user_pref(“dom.push.connection.enabled”, false);
      user_pref(“dom.push.serverURL”, “”);
      user_pref(“dom.push.udp.wakeupEnabled”, false);
      user_pref(“dom.push.userAgentID”, “”);
      // disable web/push notifications
      user_pref(“dom.webnotifications.enabled”, false);
      user_pref(“dom.webnotifications.serviceworker.enabled”, false);

      May be useful, but not for me, thanks. A gadget IMO, not to mention privacy issues (have a look at dom.push.userAgentID : I don’t like IDs).
      And thanks (once again) to Martin for clarifying this service (and in no way for discrediting it).

    6. Dwight Stegall said on March 22, 2016 at 8:38 pm
      Reply

      All I have in Service Workers in Chrome 64-bit is Google Plus and Facebook. I haven’t received any spam from them so far. For now I’ll leave them registered until I see them causing problems.

    7. Rizvi Iqubal said on January 29, 2017 at 2:04 pm
      Reply

      Check out “Clear Service Worker” – The chrome extension to clear service workers easily

      https://chrome.google.com/webstore/detail/clear-service-worker/kkbncldhbdallogkalmfgijpinjggboh?utm_source=gmail

    Leave a Reply