Why might Chrome (inside Electron) suddenly redirect to chrome-error://chromewebdata?

19,269

For some reason, your code is trying to navigate to an invalid (non-existing) URL, which then results in window.location.href being chrome-error://chromewebdata.

To reiterate: there is no direct redirection to chrome-error://chromewebdata, but instead to a URL that doesn't exist or is not reachable.

Check if your code causes this navigation (possibly a redirect). It is very useful to inspect the Network tab in DevTools, making sure that "Preserve log" is checked. This should give some indication about what exactly is happening.

Share:
19,269
trusktr
Author by

trusktr

Joe Pea trusktr.io (personal site) lume.io (open source 3D toolkit I'm working on) twitter github codepen

Updated on June 04, 2022

Comments

  • trusktr
    trusktr almost 2 years

    My electron app is randomly redirecting to chrome-error://chromewebdata, and I've no idea why. There's no errors in the console, etc.

    When the Electron app first starts, the window opens, and it redirects away from my application to that URL and I see an empty blank white screen. No user interaction is necessary, it just happens when the app starts.

    If I open devtools, I can see that window.location.href contains chrome-error://chromewebdata instead of http://localhost:9080 (the Electron app runs using a localhost URL).

    I tried deleting the local Electron/Chrome data folder at ~/Library/Application Support/my-app-name and starting over, but no luck.

    What are reasons that Chrome (in Electron?) can decide to redirect to chrome-error://chromewebdata?

  • Freddy Daniel
    Freddy Daniel over 4 years
    what should i do, If i need to handle deep link coming from browser window?
  • snwflk
    snwflk over 4 years
    How to handle dead links in Electron? I think that's a different question, warranting a new SO question.
  • Freddy Daniel
    Freddy Daniel over 4 years
    I found the way to handle it via registerFileProtocol. I will link an answer here later : )
  • Admin
    Admin over 2 years
    As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.