Bug 1728443 Comment 2 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

The issue comes from the fact that the element is in an iframe. CSS Selectors, xpath selectors etc... are always relative to the owner of the node. 
If you switch to the iframe corresponding to the element via the iframe selector, then `$x` will return the expected element.

Chrome's console behaves interestingly here. All global selector shortcuts seem to perform queries across all frames in the document. 

Technically we could probably do something similar. The question of how to show the current context of the console is a frequent issue. I'm going to block the meta Bug 1605153, which is about context selection issue.

But the approach of making some helpers work cross frames is definitely interesting. Will be triaged and assigned priority / severity in next triage meeting.
The issue comes from the fact that the element is in an iframe. CSS Selectors, xpath selectors etc... are always relative to the owner of the node. 
If you switch to the iframe corresponding to the element via the iframe selector, then `$x` will return the expected element.

~~Chrome's console behaves interestingly here. All global selector shortcuts seem to perform queries across all frames in the document.~~

~~Technically we could probably do something similar. The question of how to show the current context of the console is a frequent issue. I'm going to block the meta Bug 1605153, which is about context selection issue.~~

~~But the approach of making some helpers work cross frames is definitely interesting.~~

Will be triaged and assigned priority / severity in next triage meeting.

EDIT: I was wrong about chrome's behavior, see next comment

Back to Bug 1728443 Comment 2