传递无头选项 chrome

Passing options for headless chrome

是否可以为浏览器启动传递配置选项?

运行 在尝试 运行 持续集成 (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.

是的,应该可以。 chromeLaunchConfig object in Pa11y's settings accepts Puppeteer config options, including args, which passes Chromium flags 到无头浏览器本身。

我还没有测试过,但希望这样的东西可以在你的 Pa11y CI 设置中工作:

chromeLaunchConfig: {
    args: ['--no-sandbox']
}