You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On setting, if the new value is null then the current browsing context must disown its opener; if the new value is anything else then the user agent must call the [[DefineOwnProperty]] internal method of the Window object, passing the property name "opener" as the property key, and the Property Descriptor { [[Value]]: value, [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: true } as the property descriptor, where value is the new value.
Consider the case:
// window.opener returns a [Window]
window.opener = "foo"
// window.opener returns "foo"
window.opener = null;
// This disowns the opener as per the specification
// Should window.opener return null or "foo"?
My interpretation of the specification is that we should return "foo". This is because we disown the opener but do not call [DefineOwnProperty] because [DefineOwnProperty] is only called if the value is anything else than null.
However, quick testing in Firefox and Chrome seems to indicate they return null.
The text was updated successfully, but these errors were encountered:
Actually, upon further testing, I may be mistaken. When setting the value to "foo" in the first place, it calls [DefineOwnProperty]. So when you set it to null the second time, it appears to updates the descriptor's value to null but does not actually disown the opener.
https://html.spec.whatwg.org/#navigating-auxiliary-browsing-contexts-in-the-dom:disowned-its-opener
Consider the case:
// window.opener returns a [Window]
window.opener = "foo"
// window.opener returns "foo"
window.opener = null;
// This disowns the opener as per the specification
// Should window.opener return null or "foo"?
My interpretation of the specification is that we should return "foo". This is because we disown the opener but do not call [DefineOwnProperty] because [DefineOwnProperty] is only called if the value is anything else than null.
However, quick testing in Firefox and Chrome seems to indicate they return null.
The text was updated successfully, but these errors were encountered: