Puppeteer-extra: How to use with puppeteer-core?

Created on 14 Mar 2019  路  3Comments  路  Source: berstend/puppeteer-extra

HI,

I don't want to install full puppeteer package as it also installs a browser with it. If I want to use puppeteer-core and use installed browser to connect using chrome-launcher how would I use it with puppeteer-extra?

Most helpful comment

I鈥檝e opened https://github.com/berstend/puppeteer-extra/pull/43, so we鈥檒l see what happens; in a lot of solutions, you can probably use the new npm alias functionality (npm install puppeteer@npm:puppeteer-core) (https://github.com/npm/rfcs/blob/latest/implemented/0001-package-aliases.md)

All 3 comments

This would be great; at the moment I have to manually symlink my chromium installation into my node_modules in order to use it, because I can't use puppeteer-core along with puppeteer-extra.

I鈥檝e opened https://github.com/berstend/puppeteer-extra/pull/43, so we鈥檒l see what happens; in a lot of solutions, you can probably use the new npm alias functionality (npm install puppeteer@npm:puppeteer-core) (https://github.com/npm/rfcs/blob/latest/implemented/0001-package-aliases.md)

according to "puppeteer vs puppeteer-core" they have two main differences...

To sum up, the only differences between puppeteer-core and puppeteer are:

  • puppeteer-core doesn't automatically download Chromium when installed.
  • puppeteer-core ignores all PUPPETEER_* env variables.

You can avoid downloading chrome using the PUPPETEER_SKIP_CHROMIUM_DOWNLOAD environment variable during installation. This makes puppeteer almost identical to puppeteer-core with the added benefit of convenient env vars.

e.g. PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 npm install puppeteer

Closing this for now, please re-open if the above solution doesn't work in all scenarios. :)

Was this page helpful?
0 / 5 - 0 ratings