Skip to content

Using Google Chrome instead of Chromium

Niek van der Maas edited this page Nov 3, 2020 · 4 revisions

Chrome vs Chromium

  • Chromium is the open-source browser that Google's Chrome browser is based on
  • By default puppeteer and playwright will use the Chromium browser they ship with
  • For extra stealthiness it's advised to use a regular Google Chrome browser instead
  • The biggest difference is proprietary codec support which is missing in Chromium (which can be detected)

Example (Linux/Docker):

const puppeteer = require('puppeteer-extra')

  .launch({ executablePath: '/usr/bin/google-chrome', args: ['--no-sandbox'] }).then(async browser => {
    const page = await browser.newPage()
    await page.goto('')
    console.log(await page.evaluate(() => MediaSource.isTypeSupported('audio/aac')))
    console.log(await (await (await page.$('#summary')).getProperty('textContent')).jsonValue())
    await browser.close()

Use executablePath to point to your Google Chrome (or Canary) binary.

If you're running puppeteer on your Desktop you can find out the path of your regular browser by navigating to chrome://version/and looking at the Executable Path entry, for example:

/Applications/Google Chrome