Firefox and "registered service workers" - Questions

snowhiker

Storage Freak Apprentice
Joined
Jul 5, 2007
Messages
1,668
MUCH THANKS in advance for reading this long mess of a post.

tl;dr:
I F'ed up. Got UN-F'ed. Error happened. Error went away. Discovered something new. Confused as usual. Questions.

-----

I goofed again. So it's another pain-in-the-ass, frustrating, confusing night. I have two "users" on my system. One is for "normal use" and one has "Firefox v56 w/legacy add-ons." Firefox can never be upgraded past v56 or they no longer function.

I went over two years without screwing up, but just now I accidentally "upgraded" v56 to 70-whatever and killed my legacy Firefox setup. CRAP. Well I downloaded Firefox v56 setup, re-installed, and it looks like my plugins/setup are back to normal and working again. But now when I click the Firefox "home" button that points to, https://mail.google.com I get a "Corrupted Content Error" page.

corrupted content error.JPG
WTF?!? I can't load Gmail anymore. If I do a <ctrl-F5> I can get Gmail to load. Close the tab, hit "home" and error message again. <ctrl-F5> and Gmail loads.

I cleared the cache from tools|options|Privacy & Security|"clear now" button under Cached Web Content and Offline content. I even deleted all Gmail cookies. Still getting error. So I did this a couple times: Reboot computer. Launch Firefox. Delete cache & gmail cookies. Pressed "home" button, get error page, <CTRL-F5>, Gmail loads. Close tab. Close Firefox. Then "Rinse & Repeat" a few more times and now it looks like Gmail loads normally again. It does seem slower more laggy than normal though.

But Thank god it finally works.

Googled a bit and one suggestion was the error is caused when Firefox is downgraded. I just downgraded so that makes sense. Another suggestion mentioned it could be a problem with "registered service workers." WTF are "registered service workers." Never heard of those.

After a bit of googleing: my shaky understanding of registered service workers (RSW) is that they are some type of "script" or "background process" that happens when the browser is open even if no tabs are open on to the RSW sites?!?

So I also found out I can open a tab "about:serviceworkers" to get a list of Registered Service Workers.

I currently have 6:

Origin: https://developers.google.com
Origin: https://www.youtube.com
Origin: https://mail.google.com
Origin: https://mail.google.com
Origin: https://www.walmart.com
Origin: https://www.reddit.com

Under each is an "Update" button and a "Unregister" button.

Questions:
1) Do sites open/launch/spawn these RSW after you go to a site's page then remove them when not needed?
2) Does Firefox remove the RSW after x number of minutes, hours, days, never, after site tab is closed?
3) What does the "update" button do? Does "Unregister" button remove them, but they reload in you go back to site page?
4) Is it OK to "Unregister" the RSW and the sites will just re-install or refresh them?
5) If I "Unregister" will the site lose any/all settings I have developed while accessing the site. EX: I lose all my "watched videos" on YouTube, etc.
6) Any other info or questions I should ask or know about?

Edit: I just went to rei.com, target.com and barnesandnoble.com and now I have: Origin: https://www.target.com as another RSW. So not all sites have them?
 
Last edited:

sedrosken

Florida Man
Joined
Nov 20, 2013
Messages
1,590
Location
Eglin AFB Area
I'm at as much of a loss as you are, but I'd suggest backing up your profile and just trying to unregister them to see what happens. My money's on them reloading when you reload the page they're attached to.
 

snowhiker

Storage Freak Apprentice
Joined
Jul 5, 2007
Messages
1,668
The previously mentioned error message while accessing Gmail via Firefox has returned randomly after a few days. See pic above. I have to hit <ctrl-F5> to force a cache-less refresh of the page and then it loads. I monitor three Gmail addresses and as I load each account, first two might load but the last won't. Or first and third will load but second won't.

It's weird that only the Gmail page generates the error.

Another interesting tab can be accessed by typing, "about:debugging#workers"

This will show a green box named "Running" if the Service Worker is working. I notice that if I close the Gmail tab the box will turn to "Stopped" after about 30 seconds.

"Unregister"ing the Service Workers doesn't obviously break anything and I can't be certain if this, or deleting the Firefox cache fixes the problem. Or it just randomly works after I <ctrl-F5>, close tab, re-load the tab a few times.

A site that uses a Service Worker will "install/run" the Worker after you open a tab on their page, the Worker then runs for a while then stops.

Not all sites employ these Service Workers. Still not sure what's going on. Or why Gmail occasionally barfs on loading. Or why only Gmail barfs.
 
Top