question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ignoring request to load this main resource because it is outside the sandbox on IOS 13

See original GitHub issue

**Error ** Ignoring request to load this main resource because it is outside the sandbox on IOS 13. Its only happen on IOS 13. For IOS 13 below, everything is normal

Configurartion for webview <RNWebView ref={(ref) => (this.localWebview = ref)} originWhitelist={['*']} style={{ flex: 1 }} javaScriptEnabled domStorageEnabled allowFileAccess useWebKit startInLoadingState allowingReadAccessToURL = {'file://' + this.state.webPath} {...this.props} />

Error Message Received an unexpected URL from the web process: 'file:///var/mobile/Containers/Data/Application/44E9B0F2-0E37-4D74-A68B-334897034D7C/Documents/localWeb/survey.html' 2019-10-15 17:38:38.504492+0700 Jakpat[2593:915422] [Process] 0x107920a18 - WebPageProxy::Ignoring request to load this main resource because it is outside the sandbox

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

3reactions
northward111commented, Nov 18, 2019

I’ve got a workaround. When invoking loadFileURL: allowingReadAccessToURL: method, I passed the whole documents path instead of the parent directory as the second parameter and the problem got solved. Hope it helps.

Could you give me example, differences between whole document path and parent directory

In my case, the html file resides in the Documents directory with its whole path as “/var/mobile/Containers/Data/Application/89C6A690-498E-4AD1-8D0F-80834964CF2B/Documents/CopyToDocuments/OfflineWeb/meTab/index.html”. When loading the html in a WKWebView, I use the following method.

  • (nullable WKNavigation *)loadFileURL:(NSURL *)URL allowingReadAccessToURL:(NSURL *)readAccessURL API_AVAILABLE(macos(10.11), ios(9.0));

The “URL” parameter should exactly be “file:///var/mobile/Containers/Data/Application/89C6A690-498E-4AD1-8D0F-80834964CF2B/Documents/CopyToDocuments/OfflineWeb/meTab/index.html”. And there’s something interesting about the second parameter “readAccessURL”. At first, I set it as the parent folder path “file:///var/mobile/Containers/Data/Application/89C6A690-498E-4AD1-8D0F-80834964CF2B/Documents/CopyToDocuments/OfflineWeb/meTab”. This works fine on iOS 12 and prior but not on iOS 13. Then I changed it to the Documents folder path “file:///var/mobile/Containers/Data/Application/89C6A690-498E-4AD1-8D0F-80834964CF2B/Documents”, it worked fine on iOS 13 too. I don’t know the exact reason behind this trick. After diving into the source code of webkit, I found the place where the error information is logged. https://trac.webkit.org/export/252478/webkit/trunk/Source/WebKit/UIProcess/WebPageProxy.cpp I think there’s something wrong here.

3reactions
northward111commented, Nov 15, 2019

I’ve got a workaround. When invoking loadFileURL: allowingReadAccessToURL: method, I passed the whole documents path instead of the parent directory as the second parameter and the problem got solved. Hope it helps.

Read more comments on GitHub >

github_iconTop Results From Across the Web

WKWebview : Ignoring request to load this main resource ...
It is a permission issue, maybe a bug of WKWebView but the below steps are working for me. [1] Get access, Call loadFileURL...
Read more >
Ignoring request to load this main resource because it is ...
But in my case, I use a WKWebView to load a local html file from the documents directory. The problem only occurs on...
Read more >
iOS 13: WKWebView local HTML page ignoring load request
Prior to iOS 13 the application successfully loaded the webPage.html and received ... request to load this main resource because it is outside...
Read more >
Ignoring request to load this main resource because it is ... - 简书
WebPageProxy::Ignoring request to load this main resource because it is outside the sandbox ; = ; ] pathForResource ; @"www/alert/index" ofType ; * ......
Read more >
App Bound Domains - Use Your Loaf
WebPageProxy::Ignoring request to load this main resource because it is attempting to navigate away from an app-bound domain or navigate ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found