I believe I found the solution to the forceViewport thing, if you use setDeviceMetricsOverride…
Jonathan M. Hethey

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.