Puppeteer-firefox

# Puppeteer-firefox

Now you can use Puppeteer for Firefox (min version: Firefox/63.0.4)

Repository (opens new window)

Some of Puppeteer API methods has not supported in firefox yet. You could check status of them at Puppeteer API coverage status (opens new window)

# Installation

npm install puppeteer-firefox

# Configuration

If you want to use puppeteer-firefox, you should add it in Puppeteer section in codecept.conf.js.

  • browser: 'chrome' OR 'firefox', 'chrome' is default value
helpers: {
        Puppeteer: {
            browser: process.env.BROWSER || 'firefox',
            url: process.env.BASE_URL || 'https://example.com',
            chrome: {
                args: [
                    '--ignore-certificate-errors',
                ],
            },
            firefox: {
                args: [
                    '--ignore-certificate-errors'
                ],
            },
        },

# Run-multiple

Example multiple section in codecept.conf.js:

 multiple: {
        parallel: {
            chunks: process.env.THREADS || 30,
            browsers: [{
                browser: 'chrome',
                windowSize: '1920x1080',
            }, {
                browser: 'firefox',
                windowSize: '1920x1080',
            }],
        },
    },

# Puppeteer v2.1.0 onwards

Historically, Puppeteer supported Firefox indirectly through puppeteer-firefox, which relied on a custom, patched version of Firefox. This approach was also known as โ€œJugglerโ€. After discussions with Mozilla, we collectively concluded that relying on custom patches was infeasible. Since then, we have been collaborating with Mozilla on supporting Puppeteer on โ€œstockโ€ Firefox. From Puppeteer v2.1.0 onwards, as an experimental feature, you can specify puppeteer.launch({product: 'firefox'}) to run your Puppeteer scripts in Firefox Nightly, without any additional custom patches.

If you want to try this expirement within CodeceptJS, you should add it in Puppeteer section in codecept.conf.js.

  • browser: 'chrome' OR 'firefox', 'chrome' is default value
helpers: {
        Puppeteer: {
            browser: process.env.BROWSER || 'firefox',
            url: process.env.BASE_URL || 'https://example.com',
            chrome: {
                args: [
                    '--ignore-certificate-errors',
                ],
            },
            firefox: {
                args: [
                    '--ignore-certificate-errors'
                ],
            },
        },
Last Updated: 3/31/2020, 11:22:28 PM