Open Bug 1942439 Opened 1 month ago Updated 7 days ago

:screenshot command crops image after 10000px height

Categories

(DevTools :: General, defect, P3)

Firefox 134
defect

Tracking

(Not tracked)

People

(Reporter: 7cf148fd, Unassigned, NeedInfo)

Details

Steps to reproduce:

Trying to take a screenshot of a very long page using the ":screenshot --fullpage" command in the console.

Actual results:

The image size is limited to 10000px height. Beyond that size, the image is cropped and the bottom of the page is not included in the capture.

If --dpr option is used, the image dimension limit is multiplied by the same factor (eg with "--dpr 2" the image is cropped at the same place in the original, resulting in a cropped picture that is 20000px high)

Note that this problem does not appear when I use the Screenshot button (with the scissors). It occurs only when I use the :screenshot command in the console. (unfortunately there is no option to set the DPR with the button)

Expected results:

The capture should not be cropped.

The Bugbug bot thinks this bug should belong to the 'Firefox::Screenshots' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Screenshots

Moving to the DevTools:General component. We do have logic in the browser screenshots tool to clamp the screenshot area down to a max size (on an edge and total area) that corresponds to the max dimensions for a HTML Canvas.

Component: Screenshots → General
Product: Firefox → DevTools

We crop at 10000 px to remain in sync with https://searchfox.org/mozilla-central/rev/e85232b4b28ecc970240d39203e417d1c320623c/browser/extensions/screenshots/selector/uicontrol.js#52-53

const MAX_PAGE_HEIGHT = 10000;
const MAX_PAGE_WIDTH = 10000;

Sam, is the screenshot extension still relevant/used, the code still seems to be in central?
Otherwise we can just update to match what Firefox Screenshots is using as size limits.

Flags: needinfo?(sfoster)

(In reply to Julian Descottes [:jdescottes] from comment #3)

Sam, is the screenshot extension still relevant/used, the code still seems to be in central?
Otherwise we can just update to match what Firefox Screenshots is using as size limits.

No the extension is not maintained anymore. We've just not got around to removing it from the tree yet.
The equivalent size limits in the new implementation are at: https://searchfox.org/mozilla-central/rev/94f8fc2185ca48c98020beeff129c4d89a776af9/browser/components/screenshots/ScreenshotsUtils.sys.mjs#46-48. My understanding is that there are limits on the dimension on any edge, as well as a max total number of pixels (area).

Flags: needinfo?(sfoster)

Thanks for the feedback Sam!

So we should align with the Firefox Screenshot feature.
7cf148fd: In case you would be interested to work on this, we can mentor, it should be a straightforward JS fix.

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(7cf148fd)
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.