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