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?