在我的 centos Linux 环境中,我运行一个 Gunicorn Flask Web 服务器,随后在同一端口上通过 chrome 浏览器启动客户端 当我想用这些设置启动客户端时,页面无法正常打开。
google-chrome-stable \
--no-first-run \
--password-store=basic \
--disable-gpu \
--new-window \
--no-default-browser-check \
--no-default-browser-setting \
--user-data-dir="$user_data_dir" \
--disk-cache-dir="$user_data_dir/cache" \
"http://localhost:$port" &
--user-data-dir="$user_data_dir" \ 造成了有缺陷的行为,但仍然是必要的,因为我希望用户能够打开多个将本地文件存储在不同会话目录中的客户端。
假设之前确定端口为5000,然后chrome浏览器打开并在地址栏中显示localhost:5000,但页面仍为空白。当我刷新浏览器时,页面会加载,但地址会更改为 auto:blank,这是没有意义的。
当浏览器打开页面并在地址栏中显示正确的链接时,保留包含用户数据的设置并仅适用于单个会话可以提供所需的行为。
我尝试了所有其他可能影响该行为的铬设置。 这个问题出现在114版本上,但在chrome 94的电脑上不会出现。对我来说,无法更改版本。
在空白页面上单击 F12 + 正确的 URL 将正确的 URL 变成 about:blank,然后单击 F5 不会给我正确的页面。没有控制台错误,也没有可见的网络条目。
创建 user-data-dir 目录并在 google-chrome-stable 之前不久睡眠也没有效果。
使用 --enable-logging 记录所有内容并将其输入 chatgpt 进行解释,得到这些结果。我在使用旧版 Chrome 的计算机上没有看到这些错误:
The log errors you provided indicate several areas where Chrome is experiencing issues. Let's break down these issues:
DBus Issue:
[15081:15081:0809/145748.532428:ERROR:object_proxy.cc(590)] Failed to call method: org.freedesktop.portal.Settings.Read: object_path= /org/freedesktop/portal/desktop: org.freedesktop.DBus.Error.UnknownMethod: No such interface 'org.freedesktop.portal.Settings' on object at path /org/freedesktop/portal/desktop
This error is related to the DBus service. It indicates that Chrome is trying to interact with a service through DBus and failing because the service doesn't recognize the method being called.
Manifest Fetching Error:
[15081:15081:0809/145748.555489:VERBOSE1:extension_downloader.cc(732)] Failed to fetch manifest ...
This error suggests that Chrome couldn't fetch an extension manifest from Google's servers. This could be due to a network issue, or perhaps this particular installation of Chrome is trying to fetch something that doesn't exist or is not accessible.
Gaia Authentication Error:
[15081:15081:0809/145748.555730:VERBOSE1:gaia_auth_fetcher.cc(816)] Got authentication error
[15081:15081:0809/145748.555815:VERBOSE1:gaia_auth_fetcher.cc(817)] net_error: net::ERR_FAILED
Gaia is Google's authentication service. This suggests there's an issue with authentication, but it might not be directly related to your issue of a blank page. It might just be a side effect of running Chrome in a scripted manner without a proper user session.
Network Service Crashed:
[15081:15081:0809/145748.566833:ERROR:network_service_instance_impl.cc(558)] Network service crashed, restarting service.
This is a significant error. The network service crashing could very well result in pages not loading, as Chrome's network service is essential for making web requests.
Account Reconcilor Errors:
[15081:15081:0809/145749.975742:VERBOSE1:account_reconcilor.cc(555)] ...
These errors seem related to account management within Chrome. Like the Gaia error, it may not be directly related to your issue but rather a side effect of the environment in which you're running Chrome.
只是另一个 stackoverflow 问题,最初的搜索和问题发布期间并未提出
将标准用户数据目录复制到新目录,然后启动 google-chrome 即可获得所需的行为