Open Bug 868235 Opened 11 years ago Updated 2 years ago

window.frameElement should throw for cross-origin parents

Categories

(Core :: DOM: Core & HTML, defect, P5)

defect

Tracking

()

People

(Reporter: bholley, Unassigned)

References

Details

(Keywords: dev-doc-needed)

Right now we just return an opaque wrapper. Per the current HTML5 spec, we should throw.
Keywords: dev-doc-needed
Any further updates? I'm assuming not as I'm still seeing this very confusing behavior in the latest stable release (32.0.2, currently).

This is an important bug for me as it makes it difficult to correctly determine if the window is in a state where my JS library that seamlessly wraps a Flash plugin will work at all as I cannot detect the cross-origin/sandboxed iframe nature of the window at all.

The best I can do in Firefox right now is just figuring out if it is in a(n) (i)frame at all by checking if `window.opener == null && window.top != window`. :-\
I think returning null here is probably actually the right thing to do. I've filed [1] to discuss it.

What are you trying to determine, exactly? If you want to see if you're in an iframe, check window.parent. If you want to see if the parent is cross-origin, check if frameElement is null (or examine the parent window in some other way, per the new spec in [2]).

[1] https://www.w3.org/Bugs/Public/show_bug.cgi?id=27520
[2] https://www.w3.org/Bugs/Public/show_bug.cgi?id=20701
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
Component: DOM → DOM: Core & HTML
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.