Closed Bug 1867726 Opened 5 months ago Closed 4 months ago

Type of cross-origin iframe's "contentWindow" property is shown as "Object" and not "Window"

Categories

(DevTools :: Console, defect, P3)

defect

Tracking

(firefox123 fixed)

RESOLVED FIXED
123 Branch
Tracking Status
firefox123 --- fixed

People

(Reporter: whimboo, Assigned: nchevobbe)

References

Details

Attachments

(2 files)

I would expect to see Window as type for the contentWindow property nevertheless if it's a same-origin or cross-origin iframe. While for the former it's true the latter shows Object instead. See the screenshot.

Steps:

  1. Goto https://mathiasbynens.github.io/css-dbg-stories/iframe-navigations.html
  2. Click: Append iframe with a cross-origin URL
  3. Open the inspector, find the iframe element and use it in the console
  4. Check it's .contentWindow property

Instead of Window the type is shown as Object.

I assume that for the type detection you are not checking with Window.isInstance() but maybe just do a class name check? At least that is also the problem in our WebDriver BiDi implementation that we need to fix (bug 1867667).

Severity: -- → S3
Priority: -- → P3
Component: Debugger → Inspector

The component has been changed since the backlog priority was decided, so we're resetting it.
For more information, please visit BugBot documentation.

Priority: P3 → --

(let's put it in console since it's related to ObjectActor)

Component: Inspector → Console
Priority: -- → P3
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED

I filed Bug 1869815 to fix the "Object" to "Window" part, but this also highlighted another issue.
We're trying to retrieve the URL of the window through location.href, which does throw with a cross-process iframe contentWindow.
In such case, we can retrieve the information through the browsingContext embedder

Depends on: 1869815
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/845c8fc4db4f
[devtools] Handle cross-process iframe content window in previewers. r=devtools-reviewers,ochameau.
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 123 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: