Best use case of this I guess, is some kind of flight mode for web apps. Before going in to metro or flight, you click a button, and for example HN caches front page for you.
Caching cross-origin resources is problematic because you can't check the response code: https://stackoverflow.com/q/35626269
Writing a Service Worker
31–40 of 60 posts
Re: Writing a Service Worker
#32I always get all stoked on service workers until I remember that half my users are on safari. Then I get bummed.
But seriously it is a bummer Safari doesn't support service workers yet. It's possible higher adoption would put more pressure on Apple to add support. In the meantime it can be a great enhancement where it is supported.
Re: Writing a Service Worker
#33What borders me, is that you need an valid SSL cert for an service worker, however there is a develop/test cert here: https://github.com/Eun/test.bi
Re: Writing a Service Worker
#34I really like that button. I don't know, it just drives home the point that you care that I understood your guide -- which was clear and easy to read.
Re: Writing a Service Worker
#35I always get all stoked on service workers until I remember that half my users are on safari. Then I get bummed.
What's the difference with Safari? (not a JS dev, so this is not familiar territory)
Apple has a vested interest in pushing users towards their walled garden for apps, while Google and Mozilla are trying to bring app-like experiences to the browser. There are hints of Safari supporting serviceworkers but I'm not holding my breath.
Highly recommend Alex Russel's talk on progressive web apps as background: https://m.youtube.com/watch?v=x7cfLDFVyHo
I happen to agree that offline-readiness (via service workers) is at the core of whether the open web will continue to be a relevant medium.
Re: Writing a Service Worker
#36What does the "Got it!" button do? Just let the author know that I understood the guide? I really like that button. I don't know, it just drives home the point that you care that I understood your guide -- which was clear and easy to read.
Re: Writing a Service Worker
#37I was going to say, "Isn't this what the application cache is for?" then I looked and saw it has been removed from the standards.
Re: Writing a Service Worker
#38Best use case of this I guess, is some kind of flight mode for web apps. Before going in to metro or flight, you click a button, and for example HN caches front page for you.
More than that - service workers have background sync and stuff like that as well. Imagine a messaging app where you can read and write messages no matter what the connectivity state is, then have the phone sync when you come back online.
Re: Writing a Service Worker
#39What does the "Got it!" button do? Just let the author know that I understood the guide? I really like that button. I don't know, it just drives home the point that you care that I understood your guide -- which was clear and easy to read.
Isn't that button for acknowledging the fact that the site will use cookies?
Re: Writing a Service Worker
#40Earlier quoted context omitted.
What's the difference with Safari? (not a JS dev, so this is not familiar territory)
It's not just a safari problem, last I checked Chrome on iOS also does not support service workers, so you're just helping Android users. Apple has a vested interest in pushing users towards their walled garden for apps, while Google and Mozilla are trying to bring app-like experiences to the browser. There are hints of Safari supporting serviceworkers but I'm not holding my breath. Highly recommend Alex Russel's tal…
And desktop users of Chrome, Firefox, and soon Edge (which has support implemented behind a flag).