screenshot command in browser console is broken

NEW
Unassigned

Status

P3
normal
8 months ago
3 months ago

People

(Reporter: soeren.hentzschel, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

(Reporter)

Description

8 months ago
Created attachment 8990441 [details]
screenshot

The ":screenshot" command in the browser console does not work. As you can see in the attached screenshot the tabs have no color and the content area is blank. The browser console logged an error:

"Saved to /Users/cadeyrn/Downloads/Screen Shot 2018-07-06 at 22.35.37.png"
[Show/hide message details.] [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIAnnotationService.setPageAnnotation]"  nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)"  location: "JS frame :: resource://gre/modules/DownloadHistory.jsm :: updateMetaData :: line 130"  data: no]
Created attachment 8990449 [details]
Screenshot taken on Windows 10

FWIW, using Firefox 63.0a1 (2018-07-06) on Windows 10 there is no error logged and the browser tabs do have the correct background color.

Only the content area is blank, which is obviously an issue between chrome and content processes being split as noted at https://groups.google.com/d/msg/mozilla.dev.developer-tools/z2f_URkQxL0/aYZX4VK-AgAJ.

Sebastian

Updated

7 months ago
Priority: -- → P3
While I totally understand that this is broken, I'm curious about why are you trying to use :screenshot from the browser console. If you want to take a screenshot of the page, you can do it from the regular web console.

Is it important for you to see both the page content *and* firefox UI around it?
Are you doing blogpost/communication/docs about Firefox UI/features?
(Reporter)

Comment 3

7 months ago
> While I totally understand that this is broken, I'm curious about why are you trying to use :screenshot from the browser console.

To be honest only for QA reasons and because I didn't know that it's a command for the web console and not for the browser console. :D

> Is it important for you to see both the page content *and* firefox UI around it?

I would not say important but a capturing of content and Firefox UI would be a really nice thing. Since the integration of Firefox Screenshots I don't need a console command at all.

> Are you doing blogpost/communication/docs about Firefox UI/features?

Yes! I write a lot of blog articles about all Mozilla related topics, including articles about new Firefox features. ;)
Comment hidden (mozreview-request)
Comment on attachment 8993606 [details]
Bug 1474006 - Work in progress

This code shows a way to retrieve the content of the tab from the parent process by using the message manager.
It requires additional work to merge this screenshot into the parent process one by using Canvas API,
as well as polish and a test.
As-is, this patch will replace :screenshot done from the browser console with a screenshot of the tab, but this time the screenshot is retrieve in the parent process, where the console actor runs for the browser console.

It mostly highlights how to do the cross process communication via message managers in order to retrieve the missing piece of the screenshot.

I'm not planning to finish this patch, so anyone is free to pick this up.
Comment hidden (spam)
Blocks: 1483143
No longer blocks: 1464461
You need to log in before you can comment on or make changes to this bug.