loading...

Will iOS 14 support service workers in WKWebView?

ben profile image Ben Halpern ・1 min read

Service worker support is currently available in Safari, but not in Apple's webview component available to developers called WKWebView.

But is kind of changing, and I believe the answer is "apps web browsers" may now enable the Service Worker entitlement, but other apps using WKWebView are still not allowed to.

This is not plainly stated anywhere, here are a bunch of tweets I am using as my basis for understanding, but I'm curious if anybody understands this better than I do.

Discussion

markdown guide
 

From that same thread it seems promising to hear that by opting in to App-Bound domains developers will get access to the Service Worker support in their WKWebViews, without having to apply for the browser entitlement.

I'm torn between feeling good/bad about this. My "good" comes from (1) the improved privacy for users and (2) there's a way developers can get service worker support without the need for the entitlement (which Apple is notoriously picky in approving other similar entitlements).

On the "bad" side for me it feels like they're holding back features as hostage in exchange for privacy compliance in a rigid way (how App-Bound domains work). Also, apps that push the envelope and don't exactly fit any of these scenarios are left in a limbo, either trying to get approval for their entitlement or balancing performance features with app capabilities.

Service workers in combination with the powerful WebKit API do open up a big surface area for intrusive/malicious practices, definitely not an easy area to secure so I understand their choices even without fully embracing them 😄