Closed Bug 1743887 Opened 3 years ago Closed 2 years ago

Screenshot failed when taking screenshot of really large page

Categories

(Firefox :: Screenshots, defect, P3)

defect

Tracking

()

VERIFIED FIXED
111 Branch
Tracking Status
firefox109 --- disabled
firefox110 --- disabled
firefox111 --- verified

People

(Reporter: niklas, Assigned: niklas)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fidefe-Quality-Foundation] )

Attachments

(1 file)

Screenshot failed when taking screenshot of really large page.

Screenshots component silently fails when taking a full page screenshot on https://ffmpeg.org/ffmpeg-all.html.

We should clamp the dimensions so we can show a preview of the screenshot rather than just fail. It might be useful to have a way of messaging the user with info/warnings like this so they know they aren't necessarily getting the whole page.

Blocks: 1696573
Severity: -- → S3
Priority: -- → P3
Assignee: nobody → nbaumgardner
Status: NEW → ASSIGNED
Blocks: 1789727

Yes, this is very annoying, still nothing done after almost a year. One of the major issues is that when it fails it can lock out screen capturing completely until restarting browser.

A better way would be to simply take as many screenshots as needed. Basically just divide up the range in to maximum possible image sizes: ceil(width/maxwidth), ceil(height/maxheight) will give the nxm number of screenshots and from this one can get coordinates needed. Label indexing then is all that is needed.

Should be a relatively easy fix, will fix this bug and make things more robust.

See Also: → 1643186
Attachment #9300655 - Attachment description: Bug 1743887 - Crop screenshots when they larger than max canvas size. r=sfoster → WIP: Bug 1743887 - Crop screenshots when they larger than max canvas size. r=sfoster
Whiteboard: [fidefe-Quality-Foundation]
Attachment #9300655 - Attachment description: WIP: Bug 1743887 - Crop screenshots when they larger than max canvas size. r=sfoster → Bug 1743887 - Crop screenshots when they larger than max canvas size. r=sfoster

The following patch is waiting for review from an inactive reviewer:

ID Title Author Reviewer Status
D160565 Bug 1743887 - Crop screenshots when they larger than max canvas size. r=sfoster niklas bolsson: Inactive

:niklas, could you please find another reviewer?

For more information, please visit auto_nag documentation.

Flags: needinfo?(nbaumgardner)
Attachment #9300655 - Attachment description: Bug 1743887 - Crop screenshots when they larger than max canvas size. r=sfoster → Bug 1743887 - Crop screenshots when larger than max canvas size. r=sfoster

I'm back from PTO now and am reviewing this patch.

Flags: needinfo?(nbaumgardner)
Duplicate of this bug: 1800623
Pushed by nbaumgardner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/39f3534179a7 Crop screenshots when larger than max canvas size. r=sfoster,bolsson
Regressions: 1810864
Duplicate of this bug: 1810934

Well I had raised this few days back here https://bugzilla.mozilla.org/show_bug.cgi?id=1810934, got to know its duplicate. For now to unblock others I resolved this issue by creating an firefox extension (old school tech) which would take screenshot by doing scroll and stitch kind of concept.
So basically I take 2 screenshots considering max height of 32k.
Draw a canvas of 32k.
0 - 16k -> 1st Screenshot - paint the canvas.
16k - 32k -> 2nd Screenshot - paint the remaining canvas.
get that canvas.toDataUrl();
This would give us the require screenshot of 32k. We can increase the height and width accordingly depending on the limitation of hardware and canvas limitations.

Pushed by nbaumgardner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a57a0d7fc45d Crop screenshots when larger than max canvas size. r=sfoster,bolsson
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch
Flags: needinfo?(nbaumgardner)

Hi @Niklas I tried to verify the fix on our end but I still reproduce the issue in our latest Nightly build : 20230126212606

This is the error we are seeing in Devtools Console.
------Error in promise: BackgroundError: Error: An unexpected error occurred
callBackground moz-extension://4b807be8-2685-409d-af2c-234050981f21/selector/callBackground.js:14
catcher.js:78:15
catcher moz-extension://4b807be8-2685-409d-af2c-234050981f21/catcher.js:78
callBackground/<@moz-extension://4b807be8-2685-409d-af2c-234050981f21/selector/callBackground.js:14:19
catcher.js:79:15
catcher moz-extension://4b807be8-2685-409d-af2c-234050981f21/catcher.js:79
Unhandled error:
Object { fromMakeError: true, name: "BackgroundError", message: "BackgroundError: Error: An unexpected error occurred", stack: "callBackground/<@moz-extension://4b807be8-2685-409d-af2c-234050981f21/selector/callBackground.js:14:19\n", errorCode: undefined, popupMessage: undefined }
errorCode: undefined
fromMakeError: true
message: "BackgroundError: Error: An unexpected error occurred"
name: "BackgroundError"
popupMessage: undefined
stack: "callBackground/<@moz-extension://4b807be8-2685-409d-af2c-234050981f21/selector/callBackground.js:14:19\n"
<prototype>: Object { … }
undefined catcher.js:21:11
BackgroundError: Error: An unexpected error occurred

Flags: needinfo?(nbaumgardner)

(In reply to Rares Doghi from comment #13)

Hi @Niklas I tried to verify the fix on our end but I still reproduce the issue in our latest Nightly build : 20230126212606

This is the error we are seeing in Devtools Console.
------Error in promise: BackgroundError: Error: An unexpected error occurred
callBackground moz-extension://4b807be8-2685-409d-af2c-234050981f21/selector/callBackground.js:14
catcher.js:78:15
catcher moz-extension://4b807be8-2685-409d-af2c-234050981f21/catcher.js:78
callBackground/<@moz-extension://4b807be8-2685-409d-af2c-234050981f21/selector/callBackground.js:14:19
catcher.js:79:15
catcher moz-extension://4b807be8-2685-409d-af2c-234050981f21/catcher.js:79
Unhandled error:
Object { fromMakeError: true, name: "BackgroundError", message: "BackgroundError: Error: An unexpected error occurred", stack: "callBackground/<@moz-extension://4b807be8-2685-409d-af2c-234050981f21/selector/callBackground.js:14:19\n", errorCode: undefined, popupMessage: undefined }
errorCode: undefined
fromMakeError: true
message: "BackgroundError: Error: An unexpected error occurred"
name: "BackgroundError"
popupMessage: undefined
stack: "callBackground/<@moz-extension://4b807be8-2685-409d-af2c-234050981f21/selector/callBackground.js:14:19\n"
<prototype>: Object { … }
undefined catcher.js:21:11
BackgroundError: Error: An unexpected error occurred

Hey Rares, this is for the component version of screenshots so you'll want to set screenshots.browser.component.enabled to true in about:config

Flags: needinfo?(nbaumgardner)

Thanks for that extra info, I was able to verify the fix in our latest Nightly build 111.0a1 (2023-01-26).

Updating the main Status Flag.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: