iOS 13: WKWebView local HTML page ignoring load request

Greetings,
In my application I'm loading a locally stored webPage.html that is being packaged alongside the app inside its bundle.


Prior to iOS 13 the application successfully loaded the webPage.html and received further load events triggered by the JavaScript, these pages were loaded using load(request:) on WKWebView.


After updating the device to iOS 13 beta 3 (public) I'm getting the following error messages:

Received an unexpected URL from the web process: 'file:///var/containers/Bundle/Application/{Application Identifier}/{Application Name}.app/Html/webPage.html'
WebPageProxy::Ignoring request to load this main resource because it is outside the sandbox


Looking into it I've discovered the loadFileURL(url:, allowingReadAccessTo:) which solved the above issue.


However when the HTML page attempts to load any local reference like /nextPage it fails with the following log:

Received an unexpected URL from the web process: 'file:///nextPage'
WebPageProxy::Ignoring request to load this main resource because it is outside the sandbox


This only occurs on iOS 13 beta 3 (public),

This is not reproduceable in simulator. (simulator works out of the box, without any changes)

I haven't attempted on the iOS 13 beta 4 (developer) as of yet.

Replies

Looks like iOS 13.0b5 (17A5547d) broke WKWebView using loadFileURL (local files using file://).


Results in "WebPageProxy::Ignoring request to load this main resource because it is outside the sandbox" after an "Received an unexpected URL from the web process: 'file:///Users/felipek/Library/Developer/CoreSimulator/Devices/A533E3EF-6427-477F-B4D0-843E71BA4550/data/Containers/Data/Application/366BB0F1-7B67-441B-A406-75D76DABF510/Library/app.id/Profiles/586187784/Resources/NGTTemplateResult.html'"


Reported as FB6860565 - WKWebView: WebPageProxy::Ignoring request to load this main resource because it is outside the sandbox

After Checking on iOS 13 Beta 5 (developer) that was released recently, I've noticed that the first workaround is no longer required and WKWebView manages to load(_ request:) the local file. However the loading of /nextPage still generates the outside the sandbox error message.

Is there a solution to this problem?

@Davidosser


We have the exact issue in out application. Could you please let us know whether you managed to get a response or fix the issue ?