Search code examples
pa11y

Passing options for headless chrome


Is it possible to pass config options for browser launch?

Running into issues when trying to run continuous integration (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.

Solution

  • Yes, should be possible. The chromeLaunchConfig object in Pa11y's settings accepts Puppeteer config options, including args, which passes Chromium flags to the headless browser itself.

    I haven't tested it, but something like this should hopefully work in your Pa11y CI settings:

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