ulixee / unblocked

A suite of tools for protecting the web's open knowledge.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fullscreen screenshot has side effects

soundofspace opened this issue · comments

Taking a fullscreen screenshot does not always create the intended image.
Sometimes sides effect can be noticed, either on the image, or when running with a headfull chrome instance.
These effects are cause, by this code:

await this.devtoolsSession.send('Emulation.setDeviceMetricsOverride', {
          ...contentSize,
          deviceScaleFactor: scale,
          mobile: false,
});

Changing the viewport of the device is a clever way to take fullscreen images, but has side effects on website where this change is detected. Some issues that I saw:

  • shift of content, probably related to aspected ratio change
  • extra context that was opened by hero (querySelector.click...), is closed again
  • random weird behaviour in some components

This can partially be linked to #13., and can be solved in newer chrome versions by using captureBeyondViewport: true.

Thanks for this ticket. Great points. This entire feature has largely been driven by community needs. The captureBeyondViewport has a long history of not actually being implemented in Chrome. I saw that you did some testing, so it's clearly working to some degree now! I believe there are still Chromium tickets indicating there continue to be bugs with it. Might be worth seeing if we can find anything that's still open and if they impact our testing.

Your test PR could test previous chrome versions for you (it currently goes back to 97), but there were issues with the tmp directory.