Closed Bug 1689951 Opened 3 years ago Closed 3 years ago

Display a notification of screenshot warning and error messages

Categories

(DevTools :: General, task, P3)

task

Tracking

(firefox87 fixed)

RESOLVED FIXED
87 Branch
Tracking Status
firefox87 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

A few things can go wrong when taking a screenshot, and when that's the case, we usually print a message in the console but the user may not have it visible (screenshot can be taken from any panel with the screenshot button in the toolbox, from the inspector, and from RDM).
It would be nice to show those message in another area, when the user isn't using the console.
Looks like the notification box could be the right place to do that (and would work with RDM + closed toolbox too)

Attached image mockup

here's what it could look like

In Bug 1678483, we are putting in place a mechanism to retrieve all the messages emitted during the screenshot process, so we could consume that to show the notifications.

Depends on: 1678483

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: General → Console
Component: Console → General

I like the idea.

Nicola, perhaps this could be a good first bug? (with proper instructions provided)

Honza

Severity: -- → S3
Flags: needinfo?(nchevobbe)
Priority: -- → P3

mh, not sure. There are multiple callsites to take care of and tests to implement, and it depends on another bug at the moment

Flags: needinfo?(nchevobbe)

This patch make the warning and error messages visible when such messages were
emitted, for the RDM screenshot button, the toolbar screenshot button and the
inspector screenshot node context menu entry.
In the case of the toolbar screenshot button in the browser toolbox, we also
display the saved messages so users have a way to know where the file was saved.
We don't do anything more for :screenshot command in the console, as the messages
are already displayed directly in the console output.
Tests are added for the different use case. The RDM one is a bit different as
we can't have a viewport taller than 9999px, so we bump the dpr to make capture-screenshot
downsize it (as such image would be too big).

We take this opportunity to fix the takeNodeScreenshot helper, which was adding
a "load" event listener after setting the src on an image, which can lead to races.

Depends on D104004

Assignee: nobody → nchevobbe
Attachment #9201147 - Attachment description: Bug 1689951 - [devtools] Display notification for screenshot warnings and error messages. → Bug 1689951 - [devtools] Display notification for screenshot warnings and error messages. r=jdescottes.
Status: NEW → ASSIGNED
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/09b2d1c8bba2
[devtools] Display notification for screenshot warnings and error messages. r=jdescottes.
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/933da04d9b3f
[devtools] Display notification for screenshot warnings and error messages. r=jdescottes.
Regressions: 1692062
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch
Flags: needinfo?(nchevobbe)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: