David Schnurr
1 min readJul 26, 2017

--

While this appears to work in most cases, the issue with using setDeviceMetricsOverride is that it’s similar to resizing the browser rather than just clipping the screenshot. When the content is using vh/vw css units or window.innerHeight to dynamically size content, the result will be different.

For an example of what I’m talking about, try to screenshot apple.com with the forceViewport hack, and with your setDeviceMetricsOverride solution — you’ll see different results.

--

--

David Schnurr
David Schnurr

Written by David Schnurr

Engineering at OpenAI. Building products, tools, and data visualizations.

Responses (1)