Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 208
trusktr Avatar asked Apr 16 '19 19:04

trusktr


1 Answers

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.

like image 82
snwflk Avatar answered Sep 25 '22 03:09

snwflk