8 ms·
I have a tiny insight into this, as I've been working on a Service Worker implementation for iOS webviews (i.e. in apps, not Safari): https://github.com/gdnmob
by _alastair 9y ago
I have a tiny insight into this, as I've been working on a Service Worker implementation for iOS webviews (i.e. in apps, not Safari):
https://github.com/gdnmobilelab/SWWebView https://github.com/gdnmobilelab/SWWebView
I'd disagree with your assertion that it's not that much work :) Service Workers are their own self-contained JavaScript environments with complicated lifecycles after all.
That said, I've been surprised by now much is possible just using public APIs, but I'm not sure you could pull request a full OS implementation. For example, adding an app to home screen. That's going to need to wire into non-WebKit iOS and macOS code, which AFAIK is not open source. Workers also sometimes run when the browser is not active, and that wouldn't be a trivial thing to add.
Also, Apple started working on the Service Worker APIs recently. It's not clear exactly how much they'll implement, but it's a very positive step.