title: WKWebView loadFileURL throws WebPageProxy::Ignoring request to load this main resource because it is outside the sandbox
body: <p>I am trying to open local html file in WKWebView, but I keep getting error message:</p>
  <blockquote>
  <p>Received an unexpected URL from the web process: 'file:///Users/username/Library/Containers/dev.WebView/Data/file:/Users/username/Documents/WebView/WebView/WebView/WebContent/index.html'</p>
  <p>2020-01-30 09:36:38.817862+0100 WebView[1679:20612] [Process] 0x101043e20 - WebPageProxy::Ignoring request to load this main resource because it is outside the sandbox</p>
  </blockquote>
  <p>This is the code that I tried:</p>
  <pre><code>    NSString *path = @&quot;file:///Users/username/Documents/WebView/WebView/WebView/WebContent/index.html&quot;;
      NSURL *url = [NSURL fileURLWithPath:path];
              
      [_webView loadFileURL:url allowingReadAccessToURL:url];
  </code></pre>
  <p>I have also tried allowing access to the Documents directory with:</p>
  <pre><code>    NSString *path = @&quot;file:///Users/username/Documents/WebView/WebView/WebView/WebContent/index.html&quot;;
      NSURL *url = [NSURL fileURLWithPath:path];
              
      NSURL *documentsURL = [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] objectAtIndex:0];
      [_webView loadFileURL:url allowingReadAccessToURL:documentsURL];
  </code></pre>
  <p>I have also enabled Outgoing Connections (Client) in Signing &amp; Capabilities settings of the projects, does not help either.</p>