fix: install puppeteer if executablePath not given (#9)#30
Open
Symbitic wants to merge 11 commits intolucacasonato:mainfrom
Open
fix: install puppeteer if executablePath not given (#9)#30Symbitic wants to merge 11 commits intolucacasonato:mainfrom
Symbitic wants to merge 11 commits intolucacasonato:mainfrom
Conversation
src/deno/Puppeteer.ts
Outdated
| ): Promise<Browser> { | ||
| if (options.product) this._productName = options.product; | ||
| if (!options.executablePath && !this._downloaded) { | ||
| await installPuppeteer({ enableLog: false }); |
Owner
There was a problem hiding this comment.
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.
Author
There was a problem hiding this comment.
@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.
Author
|
@lucacasonato any updates? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.