Post

Replies

Boosts

Views

Activity

Issues with Safari dev tools + WKWebView + local URL + iOS 18 simulator
When I'm inspecting a WKWebView in a simulator and the WKWebView loads a local URL with a port number, I've found that most features of Safari dev tools that worked in iOS 17 are broken in iOS 18. Here are the steps I'm taking: Set up a WKWebView with isInspectable = true that loads a local URL, e.g. https://www.local.mydomain.com:3000 Install a self-signed SSL certificate on a simulator for www.local.mydomain.com Run my app on the simulator The WKWebView loads successfully In Safari on my Mac, I can select the WKWebView and open dev tools to inspect it If the simulator is on iOS 17, this works fine, no issues. But if the simulator is on iOS 18, Safari dev tools are mostly broken. I can tell that there is a connection to the WKWebView because the Network tab logs the requests that I expect. But I cannot use any of the other dev tools features: Elements, Sources, Console, etc. Has anyone else encountered this? Is there a workaround?
1
0
229
Dec ’24
WKWebView cannot load non-app-bound domains
WKWebView question...I've set up WKAppBoundDomains and am using limitsNavigationsToAppBoundDomains to enable evaluateJavaScript, Service Workers, etc. That's all working great. However, I'm no longer to able to load a WKWebView with any domain that is not one of the app-bound domains. For these other webviews, I don't need any of the special restricted APIs. I just want them to load and do basic website stuff. My impression from the docs is that this should be fine. Does it require explicitly setting config.limitsNavigationsToAppBoundDomains = false? Unfortunately I can't do that in all cases; some of the WKWebViews are created by external libraries where I can't edit the WKWebViewConfiguration Is there another step I need to take? Or, maybe something with a ContentWorld?
1
0
1.9k
Feb ’24