On a high DPI screen, where window.devicePixelRatio is 2, for example, taking screenshots should use a scale of 2. It would, by default if it weren't for the fact that Emulation.setDeviceMetricsOverride is invoked, setting the deviceScaleFactor to 1. It's unclear why this is necessary, as both headed and headless mode appear to work without it.
Furthermore, if you take a screenshot during headed mode and deviceScaleFactor is reduced to 1, it causes an unsightly flash as Chrome scales the viewport down by half before taking the screenshot.
On a high DPI screen, where window.devicePixelRatio is 2, for example, taking screenshots should use a scale of 2. It would, by default if it weren't for the fact that
Emulation.setDeviceMetricsOverride
is invoked, setting thedeviceScaleFactor
to 1. It's unclear why this is necessary, as both headed and headless mode appear to work without it.Furthermore, if you take a screenshot during headed mode and
deviceScaleFactor
is reduced to 1, it causes an unsightly flash as Chrome scales the viewport down by half before taking the screenshot.It also seems to be related to and/or cause this issue: https://github.com/rubycdp/ferrum/issues/203
Is the line necessary at all or can it be removed?
Thanks!