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.

net::ERR_ACCESS_DENIED When Rendering Local HTML

See original GitHub issue

Bug description:

I am trying to display a local PDF in base64. I have assigned all the correct permissions to view the document. When I try to render it I get the error net::ERR_ACCESS_DENIED. This only happens on Android.

To Reproduce:

Create a WebView Use a path in the local system Try to view the WebView https://github.com/ALEEF02/Bulletin-Magazine-Mobile-App/blob/da41ff504d1ad2a5463b2d062adaa66fb54c61c2/rn-pdf-reader-js/index.js#L200

Expected behavior:

The WebView should be able to render to specified PDF in the local files

Screenshots/Videos:

image (1) image IMG_4626

Environment:

  • OS: Android
  • OS version: Unknown
  • react-native version: 34.0.2
  • react-native-webview version: 7.5.1

Issue Analytics

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

github_iconTop GitHub Comments

14reactions
seancheungcommented, Jan 6, 2021

Here is the fix:

const [uri, setUri] = useState(null);

useEffect(() => {
  setUri('blahblah');
  return () => {
    setUri(null);
  };
}, []);
3reactions
alancwoocommented, Oct 29, 2020

I’m also really not sure why this issue is closed. I 'm having the same issue with react-native 0.63.3, react-native-webview ^10.10.0, tried everything with all flags and the state.renderedOnce solution above:

<WebView
  allowFileAccess={true}
  originWhitelist={['*']}
  javaScriptEnabled={true}
  domStorageEnabled={true}
  source={this.state.renderedOnce ? {uri: this.state.cachedItemPath} : undefined}
  allowFileAccess={true}
  allowUniversalAccessFromFileURLs={true} />

I’m trying to render some html that was saved to local storage.

It works perfectly on iOS.

Read more comments on GitHub >

github_iconTop Results From Across the Web

having 404 error when rendering local html file in vue.js
I'm trying to render a local html file in vue.js. However, I'm having 404 errors. following is my code. This is index.vue file....
Read more >
837920 - Chrome displaying source code instead of rendering ...
Issue 837920: Chrome displaying source code instead of rendering webpage when loading local HTML files without file extension. Reported by schedule mikei.
Read more >
Untitled
Bleach movie 4 download link, Stsadm access denied windows 2003, Penthouses in london that ... Render html in java, Sell my timeshare now...
Read more >
Webshot a locally rendered RMD as HTML after running some ...
Try to use webshot to take first render image in an html and capture a screenshot of the image as a png ....
Read more >
Untitled
Siames personas, Tenant allowance accounting, Dedham local access tv, ... Attrib access denied recycle bin, Manipulacion de embriones bioetica, ...
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