Skip to content
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

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

Closed
aaronjensen opened this issue Jan 22, 2023 · 0 comments · Fixed by #331
Closed

Comments

@aaronjensen
Copy link
Contributor

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant