-
-
Notifications
You must be signed in to change notification settings - Fork 45
fix: install puppeteer if executablePath not given (#9) #30
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
base: main
Are you sure you want to change the base?
Conversation
src/deno/Puppeteer.ts
Outdated
| ): Promise<Browser> { | ||
| if (options.product) this._productName = options.product; | ||
| if (!options.executablePath && !this._downloaded) { | ||
| await installPuppeteer({ enableLog: false }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should still log out that it is going to install puppeteer. The script just hanging for 25 seconds on first use is kinda weird.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lucacasonato I added it so that it logs by default. I also added log levels. Minimal level will just print out a simple "Downloading chrome/firefox" message. Default logging (including progress bar) is still what it does right now. If you want to switch to using the "minimal" message, just change this: https://github.com/Symbitic/deno-puppeteer/blob/main/src/deno/Puppeteer.ts#L149
Otherwise, I can use logLevel as suitable for my use cases.
|
@lucacasonato any updates? |
This implements the second solution that @lucacasonato suggested in #9. It will install the latest Chromium if no
executablePathis given topuppeteer.launch.It adds an uninstall script so that this can be tested separately in CI. This doesn't break anything, so the install script can still be used when desired. It does disable the progress bar when installing from
puppeteer.launch, which might cause confusion for some users because it will take a long time to download without indicating why.