-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
Describe the problem
Extension of wry#1587. On iOS Service Workers are disabled in WKWebView by default.
This can be fixed by setting App-Bound Domains for iOS in Info.plist
in addition to running
webViewConfiguration.limitsNavigationsToAppBoundDomains = YES;
on the WKWebViewConfiguration object. Then all WKWebViews used in the app are able to use Service Workers [source].
It additionally further locks down the WKWebView to only allow requests to resources from domains which are explicitly whitelisted. That said, I mainly want the feature so I can use a Service Worker in my Tauri App.
Describe the solution you'd like
I'd like to extend the API in Wry as of (tauri-apps/wry#1588) into the WebviewBuilder and the WebviewWindowBuilder structs in Tauri.
Alternatives considered
I considered using a Tauri plugin; unfortunately the reference to the WKWebviewConfiguration object is not made available to a Tauri plugin, at least as far as I could tell.
Additional context
App-Bound Domains Blog Post: https://webkit.org/blog/10882/app-bound-domains/
StackOverflow issue about enabling Service Workers in WKWebViews: https://stackoverflow.com/questions/49673399/service-workers-unavailable-in-wkwebview-in-ios-11-3/64155509#64155509