是否可以为浏览器启动传递配置选项?
尝试运行持续集成时遇到问题 (CircleCi)
Launching Headless Chrome
Failed to launch chrome!
[0731/172545.445686:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
是否可以为浏览器启动传递配置选项?
尝试运行持续集成时遇到问题 (CircleCi)
Launching Headless Chrome
Failed to launch chrome!
[0731/172545.445686:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
是的,应该是可以的。Pa11y 设置中的chromeLaunchConfig 对象接受 Puppeteer 配置选项,包括args
,它将Chromium 标志传递给无头浏览器本身。
我还没有测试过,但希望这样的东西可以在你的 Pa11y CI 设置中工作:
chromeLaunchConfig: {
args: ['--no-sandbox']
}