Closed hatemhosny closed 3 years ago
This change was integrated into v0.2.0, as well as allowing for additional viewport options to be defined in the CLI via the key=value,
format e.g. --viewport="800,600,deviceScaleFactor=2"
. From my limited tests, it seems --launch-arguments="--device-scale-factor=2"
or --launch-arguments="--force-device-scale-factor=2"
does not seem to do anything more than change the deviceScaleFactor of the viewport, so it's probably a better practice to set the scale factor via the viewport option.
Setting viewport was overriding puppeteer
launchOptions
that set device scale factor https://github.com/tungs/timesnap/blob/master/index.js#L161this does not allow improving image quality by setting
--launch-arguments="--device-scale-factor=2"
, or alternatively--launch-arguments="--force-device-scale-factor=2"
, as mentioned in #30This fixes it by extracting these options and adding them to config.viewport
You may consider also doing that for the rest of the properties https://pptr.dev/#?product=Puppeteer&version=v5.0.0&show=api-pagesetviewportviewport
I believe this is an important setting for image quality, so you may also consider making it a cli arg