I have an application that displays some HTML content with a WKWebView.
I'm using a WKURLSchemeHandler attached to the webview configuration to respond to requests for local resources.
This works as expected for img tags. I'm able to handle the requests for those images in my WKURLSchemeHandler instance and see the content displayed in the webview.
However, when I try to load a resource with my custom scheme using fetch() I consistently get 3 subsequent error messages in the safari dev console.
[blocked] The page at <my pages location> was not allowed to display insecure content from mycustomscheme://<some resource>
Not allowed to request resource
fetch cannot load mycustomscheme://<some resource> due to access control checks.
It seems to be ambiguous in the documentation for WKURLSchemeHandler whether it should be able to service requests from fetch and/or XMLHttpRequest.
Is this explicitly not supported or is there perhaps something I'm missing that would make this work?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
My team has a set of XCTestCases which create a new instance of WKWebView, execute some javascript with it, then assert some conditions afterward.
Beginning with iOS 16, these tests never succeed because it seems like the WKWebView is experiencing some sort of crash or malfunction in its content process.
When executing a single test of the type above, the following is present in the console:
[Process] 0x142481000 - [PID=0] WebProcessProxy::didFinishLaunching: Invalid connection identifier (web process failed to launch)
[Process] 0x142481000 - [PID=0] WebProcessProxy::processDidTerminateOrFailedToLaunch: reason=Crash
[Process] 0x7f7d86008220 - [pageProxyID=6, webPageID=7, PID=0] WebPageProxy::processDidTerminate: (pid 0), reason=Crash
[Loading] 0x7f7d86008220 - [pageProxyID=6, webPageID=7, PID=0] WebPageProxy::dispatchProcessDidTerminate: reason=Crash
[Loading] 0x7f7d86008220 - [pageProxyID=6, webPageID=7, PID=0] WebPageProxy::dispatchProcessDidTerminate: Not eagerly reloading the view because it is not currently visible
I've tried ensuring that an app host is present for the test target these tests execute in and that had no effect. I've tried adding the webview to the apps view hierarchy and that had no effect.
In iOS 15 and prior these same tests execute and pass fine.
Was there some change in iOS 16 that may have caused this or any ideas on how to rectify this?