We show local web content in our app that we do not have control over. The complete web app is part of the app bundle. It loads data from a local file via XMLHttpRequest. This has been working fine with UIWebView.
We use loadFileURL(url, allowingReadAccessTo: Bundle.main.bundleURL) to load the main HTML file from the app bundle. When using WKWebView the XMLHttpRequest of the web app fails. All other local resources referenced in the HTML load fine.
If we set the undocumented preference allowFileAccessFromFileURLs to true on WKWebViewConfiguration the XMLHttpRequest works as expected.
See also: FB7539717
We use loadFileURL(url, allowingReadAccessTo: Bundle.main.bundleURL) to load the main HTML file from the app bundle. When using WKWebView the XMLHttpRequest of the web app fails. All other local resources referenced in the HTML load fine.
If we set the undocumented preference allowFileAccessFromFileURLs to true on WKWebViewConfiguration the XMLHttpRequest works as expected.
See also: FB7539717