You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Screenshots are white beyond the window size when using setDeviceMetricsOverride #81
changed the title [-]Screenshots are white beyond the window size[/-][+]Screenshots are white beyond the window size when using `setDeviceMetricsOverride`[/+]on Apr 6, 2022
I now get a 1905x28962 screenshot, which is almost what I expected: I'd like it to be 1920 in width, so I'm looking for a way to turn the Chrome instance to full-screen mode.
confirms that values are set. (But maybe that effort is misguided anyway, as Chrome does not have any left/right borders in non-full-screen mode. It might be related to the scrollbars taking space despite being invisible.)
Activity
[-]Screenshots are white beyond the window size[/-][+]Screenshots are white beyond the window size when using `setDeviceMetricsOverride`[/+]bersbersbers commentedon Apr 6, 2022
Looks like this exact problem has been seen before, although in a different context:
chromote/R/screenshot.R
Lines 72 to 80 in 865e24e
I debugged this a bit, and
overall_heightseems to be correct (28963 [pixels, I guess] in my case).setVisibleSizeis experimental and deprecated, see https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setVisibleSize and compare Do not use Emulation.setVisibleSize GoogleChrome/lighthouse#2831.I found
captureBeyondViewport, see https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-captureScreenshot.This worked for me:
There's some related discussion in https://bugs.chromium.org/p/chromium/issues/detail?id=1198576 which I did not fully read.
I now get a 1905x28962 screenshot, which is almost what I expected: I'd like it to be 1920 in width, so I'm looking for a way to turn the Chrome instance to full-screen mode.
does not change the width of the snapshot, although
confirms that values are set. (But maybe that effort is misguided anyway, as Chrome does not have any left/right borders in non-full-screen mode. It might be related to the scrollbars taking space despite being invisible.)