Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider deferring browser download #19211

Open
timvandermeij opened this issue Dec 10, 2024 · 1 comment
Open

Consider deferring browser download #19211

timvandermeij opened this issue Dec 10, 2024 · 1 comment
Labels

Comments

@timvandermeij
Copy link
Contributor

Currently the browsers for the tests are downloaded when npm install is invoked so that all test dependencies are present right away without further setup. This was also needed before because there was no way in Puppeteer to selectively download browsers at a later time.

However, nowadays Puppeteer exposes a separate browsers package/CLI. This could allow us to defer downloading of the actual browsers until the tests are actually started. This could be good for two reasons:

  1. It avoids problem in e.g. the CI build if a new nightly release is published and the version rollover happens; see [Bug]: Get a 404 when trying to download Firefox during its version transition puppeteer/puppeteer#10414.
  2. It will likely reduce the installation time which benefits the CI build too because it doesn't actually use the browsers.
@Sev6n
Copy link

Sev6n commented Dec 17, 2024

Wow, this is a good proposal. Since it reduces installation times and improves CI efficiency. While Puppeteer is more associated with Chromium, it has Firefox support now.

You can install Firefox with @puppeteer/browsers:
Just use the npx @puppeteer/browsers install command, specifying Firefox.

npx @puppeteer/browsers install firefox@<version> --path ./browsers
(example): npx @puppeteer/browsers install firefox@114.0 --path ./browsers

Or if you want the stable version:
npx @puppeteer/browsers install firefox --path ./browsers

Now you can configure Puppeteer to use the Firefox you just installed. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants