by thagsimmons · 4y ago · 0 comments
https://bugzilla.mozilla.org/show_bug.cgi?id=1320796
Firefox will eventually catch up. The possibilities for this approach are actually quite interesting, and go far beyond the much less useful scheme you outlined that relegates it strictly to just being an optimization.
I’ll tweak my statement slightly: for regular site functionality, service workers must be optional. Depending on service workers for anything that does not inherently require them (like background sync or receiving push messages) is bad.
But that doesn't rule it out in some special case. Special cases are special. (I recently wrote a Chrome-only web app because it requires access to the serial port.)
I say: feel free to use service workers, but do not feel free to depend on service workers. They must be optional in general-purpose websites.
At any rate, this is more of a StackOverflow question than an HN question, and the details of what works will differ from project to project.
https://stackoverflow.com/questions/51597231/register-servic...
Or access to CacheStorage, and acting as an offline server when the network is unavailable. Perfectly reasonable to depend on if your use case requires it.
I don't agree with this because you're essentially defending writing websites and apps for specific browsers. "Oh, this doesn't work in your browser because it requires [specific tech|devs to test in more than one browser|whatever]" is a lame excuse in a world where progressive enhancement has been an accepted approach to developing web software for twenty years.
As a tech demo to show something is possible it's fair enough, but in the real world this shouldn't ever happen.