Wrong URL for iframe created by DevTools after using document.open
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
People
(Reporter: jdescottes, Unassigned)
References
Details
Attachments
(1 file)
|
1.06 KB,
text/html
|
Details |
While implementing the browsingContext.historyUpdated event for WebDriverBidi, we noticed an inconsistency for iframes created via the Debugger API compared to regular iframes. Both DevTools and BiDi use executeInGlobalWithBindings in order to evaluate code so they are both affected in the same way.
The issue occurs when adding an empty iframe dynamically in a page and calling document.open() on its document:
const frame = document.createElement("iframe");
document.body.append(frame);
frame.contentDocument.open();
console.log(frame.contentDocument.location.href);
At this point, per 12.1 of https://html.spec.whatwg.org/#document-open-steps frame.contentDocument.location.href should be the URL of the parent page. This is the case when this script is coming from the content page. But evaluating it from DevTools we get about:blank. See attached test case.
| Reporter | ||
Updated•11 months ago
|
Comment 1•11 months ago
|
||
I am happy to do some investigation about this one
Comment 2•10 months ago
|
||
Sorry I won't have time to work on this, removing my NI.
Description
•