Add Service Worker support in WKWebView

Originator:janison.solutions
Number:rdar://51092505 Date Originated:May 24 2019, 12:23 PM
Status:Open Resolved:
Product:iOS + SDK WebKit Product Version:12.3
Classification:Suggestion Reproducible:
 
Summary:
WKWebView does not currently support Service Workers. Please add support for this functionality as it is critical to providing low bandwidth and offline solutions for iOS apps that use WKWebView.

Some history regarding WKWebView's lack of support for Service Workers is detailed in this article.
https://medium.com/@firt/progressive-web-apps-on-ios-are-here-d00430dee3a7

An entitlement was added in iOS 11.3 beta, but it never made it into the release.
https://stackoverflow.com/questions/49673399/service-workers-unavailable-in-wkwebview-in-ios-11-3

Steps to Reproduce:
1. Install app "WebView - WKWebView and UIWebView rendering" https://itunes.apple.com/us/app/webview-wkwebview-and-uiwebview-rendering/id928647773?mt=8
2. Launch app and click on "WKWebView"
3. Enter URL https://jakearchibald.github.io/isserviceworkerready/ 
4. Go to navigator.serviceWorker and click on "Test" link
5. WKWebView redirects to https://jakearchibald.github.io/isserviceworkerready/demos/navigator.serviceWorker/

Expected Results:
Expecting tests to pass. Output expected:
 navigator.serviceWorker, [object ServiceWorkerContainer]

Actual Results:
The test fails. Output actual:
 navigator.serviceWorker, 

Version/Build:
iOS 12.3

Configuration:
N/A

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!