Developer tools do not work in a popup window
Categories
(DevTools :: General, defect, P2)
Tracking
(Not tracked)
People
(Reporter: dmt.shvedov, Unassigned)
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:72.0) Gecko/20100101 Firefox/72.0
Steps to reproduce:
A lot of developer tools don't work in a popup window (created through window.open).
- View source maps (while visible in main window)
- Pause code execution through hotkey
- Break on ... > Subtree modification
- things like Document.getElementById() only look through DOM in main window, but not in popup
Actual results:
- Not showing any
- Since there's no code, there's nothing to pause
- My action is ignored
- Element not found
Expected results:
Whatever happens in a normal window
- Source shows up
- Code gets paused
- I can break on subtree modification.
- Element gets found.
These were discovered when while trying to debug display issues of a dropdown in a popup window. Basically debugging is impossible. You simply have no way of pausing the code while dropdown is open. You can't console.log any part of the DOM either, because stuff in popup window can't be accessed.
Hi,
Thanks for reporting this bug.
As a starting point, I've chosen a component for this bug in the hope that someone with more expertise may look at it.
In the meantime, can you download the latest Firefox Nightly https://nightly.mozilla.org/ and verify if you are able to reproduce the reported issue as well?
Thanks,
Virginia
Hi Virginia,
Confirmed on latest nightly.
Comment 4•5 years ago
|
||
Dmitry, would you have a more detailed test case please? I tested a random window.open("https://mozilla.org") and was able to inspect the new tab being created and evaluate things in the console.
What am I missing?
Nicolas, it's a React SPA that uses react-new-window package to create the popup. I'll try to make a minimal test case whenever I find time.
Comment 7•5 years ago
|
||
see https://rmariuzzo.github.io/react-new-window/
I can reproduce 1. 2. and 3.
for 4. I can't reproduce, I am able to query the dom of the page in the window. Do you mean that you execute the document.getElementById from the original tab? if so it's normal to not find elements in the window that was created, as its a separate document.
Also highlighting elements does not seem to work in the window.
We should probably try to break this bug into multiple smaller ones, so they're more actionable.
(In reply to Nicolas Chevobbe [:nchevobbe] from comment #7)
see https://rmariuzzo.github.io/react-new-window/
I can reproduce 1. 2. and 3.
for 4. I can't reproduce, I am able to query the dom of the page in the window. Do you mean that you execute the
document.getElementByIdfrom the original tab? if so it's normal to not find elements in the window that was created, as its a separate document.Also highlighting elements does not seem to work in the window.
We should probably try to break this bug into multiple smaller ones, so they're more actionable.
Yes, you're correct about (4)
Comment 9•5 years ago
|
||
(In reply to Nicolas Chevobbe [:nchevobbe] from comment #7)
Also highlighting elements does not seem to work in the window.
I can reproduce this too, and it seems to be coming from this line:
// Only try to create the highlighter when the document is loaded,
// otherwise, wait for the navigate event to fire.
if (doc.documentElement && doc.readyState != "uninitialized") {
this._createHighlighter();
}
The window that gets created with window.open with the about:blank URL has a readyState value equal to uninitialized, so the highlighter never gets created.
Updated•3 years ago
|
Description
•