Skip to content

Emulation.setDeviceMetricsOverride causes wrong scale to be used for screenshots #330

@aaronjensen

Description

@aaronjensen

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.

It also seems to be related to and/or cause this issue: #203

Is the line necessary at all or can it be removed?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions