Post

Replies

Boosts

Views

Activity

Reply to WKWebView cannot load non-app-bound domains
For anyone else who comes across this in the future... Once you upgrade some of your WKWebViews by using WKAppBoundDomains, other domains are downgraded and lose features. A good example is evaluateJavaScript. It works in any WKWebView by default. But as soon as you create a WKAppBoundDomains array in your Info.plist, the default changes and becomes more strict. Now, using evaluateJavaScript has two requirements: the domain of the WKWebView must be in the app-bound domains array and WKWebViewConfiguration.limitsNavigationsToAppBoundDomains must be true. If a WKWebView tries to use evaluateJavaScript but does not meet both of those requirements, it will fail loading.
Mar ’24