Post

Replies

Boosts

Views

Activity

Reply to Issues with Safari dev tools + WKWebView + local URL + iOS 18 simulator
Answering my own question. The issue: Affects both WKWebView and Safari Is not specific to iOS 18 Does not affect just local URLs; I can reproduce it during a port forwarding session to an external domain How to reproduce with Nextjs which is the framework I'm using: Install a self-signed certification for a domain like Start a Nextjs dev server Open any page in the Nextjs dev server in Safari on a Simulator Open Safari Dev Tols The Elements tab will be either empty or show only the very top level elements of the DOM. The Network and Sources tab will show a correct list of resources that have been loaded but won't show the responses as you'd normally see.
Feb ’25
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.
Topic: App & System Services SubTopic: Core OS Tags:
Mar ’24