chrome-debugging-client
chrome-debugging-client copied to clipboard
Proposal: Add `spawnOrInstallChrome` method
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 puppeteer
s 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
Thank you for the proposal @rwjblue - I am in agreement that this API should be included and will queue the work for this implementation.