且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为什么Chrome(在Electron内部)突然重定向到chrome-error:// chromewebdata?

更新时间:2022-06-24 15:10:15

由于某种原因,您的代码试图导航到无效(不存在)的URL,然后导致 window.location.href chrome-error:// chromewebdata

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.

要重申:没有直接重定向到 chrome-error:// chromewebdata ,但改为不存在或无法访问的URL。

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

检查您的代码是否导致此导航(可能是重定向)。检查DevTools中的网络选项卡,确保已选中保留日志,这非常有用。这应该可以说明到底发生了什么。

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.