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

Proposal: Add spawnOrInstallChrome method #48

Open
rwjblue opened this issue Aug 27, 2019 · 1 comment
Open

Proposal: Add spawnOrInstallChrome method #48

rwjblue opened this issue Aug 27, 2019 · 1 comment
Assignees

Comments

@rwjblue
Copy link

rwjblue commented Aug 27, 2019

Motivation

In scenarios where Chrome would not necessarily be guaranteed to be installed (e.g. CI environments, "end user machines" via npx some-thing) and in those cases using spawnChrome will error (lazily when you actually try to "do something" the first time).

puppeteer "solves" this by always installing Chrome during puppeteers postinstall hook, which takes a bit of time during installation. This ensures that all users have Chrome installed and therefore that puppeteer itself works, but since most of the time the user will already have Chrome installed this leads to wasted work / time.

Proposal

Add a new method (straw man name): spawnOrInstallChrome that will attempt to use the ambiently available Chrome instance (I'm assuming it can literally use spawnChrome for this part), and if an ambient Chrome is not available fall back to fetching Chrome before continuing.

This would reduce wasted time (vs puppeteer's setup and vs setting up Chrome eagerly in CI environments that already have it), but still allow tools that run on "uncontrolled environments" work without putting this problem on the authors of those tools.

Additional Information

See here for how puppeteer fetches and installs Chrome

Example project that needs to be able to run on arbitrary machines (when we cannot know ahead of time that Chrome is installed)

@lynchbomb
Copy link
Member

Thank you for the proposal @rwjblue - I am in agreement that this API should be included and will queue the work for this implementation.

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

No branches or pull requests

3 participants