Closed Bug 1498143 Opened 3 years ago Closed 3 years ago

Screenshot node menu item doesn't do anything


(DevTools :: General, defect, P1)

62 Branch


(firefox65 verified)

Firefox 65
Tracking Status
firefox65 --- verified


(Reporter: gk, Assigned: jdescottes)





(3 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0

Steps to reproduce:

1. Go to 
2. Select div id="dvz-1842_ai2html_trojan-box"
3. Right-click and click on Screenshot node

Actual results:


Expected results:

A screenshot is saved
>1. Go to 
go to ?
Flags: needinfo?(gk)
>2. Select div id="dvz-1842_ai2html_trojan-box"
How do you select that div ?

There is no div with that name in the source of that page.

Please provide a screenshot of your selection (use the windows screenshot function).
Flags: needinfo?(gk)
Attached image ai2html-node.PNG
Here is one.
Flags: needinfo?(gk)
Component: Untriaged → Screenshots
This looks like dev tools screenshot issue
Component: Screenshots → General
Product: Firefox → DevTools
Thanks for filing, I was able to reproduce the issue, and when it happened the following JS errors appeared in the Browser Console:

> Error while calling actor 'screenshot's method 'capture' node is null; can't access its "ownerDocument" property

> getRect@resource://devtools/shared/base-loader.js -> resource://devtools/shared/layout/utils.js:282:7
> createScreenshotDataURL@resource://devtools/shared/base-loader.js -> resource://devtools/shared/screenshot/capture.js:70:37
> captureScreenshot@resource://devtools/shared/base-loader.js -> resource://devtools/shared/screenshot/capture.js:41:10
> capture@resource://devtools/shared/base-loader.js -> resource://devtools/server/actors/screenshot.js:18:12
> handler@resource://devtools/shared/base-loader.js -> resource://devtools/shared/protocol.js:1198:21
> onPacket@resource://devtools/shared/base-loader.js -> resource://devtools/server/main.js:1313:15
> receiveMessage@resource://devtools/shared/base-loader.js -> resource://devtools/shared/transport/child-transport.js:66:5

> Protocol error (unknownError): node is null; can't access its "ownerDocument" property
Ever confirmed: true
Priority: -- → P1
I think this is related to capturing nodes within iframes. The code in devtools/shared/screenshot/capture.js:70 seems to always use the top level document, but then can't find the target node by its selector if that node is inside a sub-document (in an iframe).
Minimal test URL: data:text/html,<iframe srcdoc="<div id=test>screenshot me</div>">
Inspect the element inside of the iframe, right click on it in the inspector, try to use the "screenshot node" menu.
This is an idea for how this might work.
This is creating an array of parent iframe selectors in the inspector, and then using this array to find the correct node.
I do not have time to work on this right now, but if this is the right approach, then we need to polish this up and potentially add:
- tests (there does not seem to be any tests today for the node screenshot feature)
- supports for shadow DOM (although this could be done in a follow-up too)
Assignee: nobody → pbrosset
Assignee: pbrosset → nobody
Assignee: nobody → jdescottes
Pushed by
Pass nodeActorID to screenshot actor to enable feature in iframes and shadowroots;r=pbro,yulia
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 65
Flags: qe-verify+
I have managed to reproduce this issue on an affected Firefox 62.0.3 build using Windows 10 x64  by following the STR from comment 0. 

This issue is verified fixed using Firefox 65.0b6 on the following OSes: Windows 10 x64, Ubuntu 18.04 x64, macOS 10.14.
Flags: qe-verify+
Flags: qe-verify+
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.