Closed Bug 757939 Opened 13 years ago Closed 13 years ago

As a popup's opener is navigating from same- to cross-origin, reading window.location.href throws while window.history.back() still works

Categories

(Core :: DOM: Navigation, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: justin.lebar+bug, Unassigned)

References

Details

Of course, you can't read window.location.href cross-origin. Similarly, history.back() has no effect on a cross-origin window.opener. (Doesn't throw; just silently fails.) This appears to be specific to window.opener -- I *can* call back() on a cross-origin popup I opened myself. The testcase in bug 757376 does var i = setInterval('try{opener.location.href}catch(e){opener.history.back();clearInterval(i)}',10) The fact that this does something indicates that opener.location.href stops working before opener.history.back() stops working. Which is probably a bug. I don't think fixing this is how we should fix bug 757376, but this behavior still seems wrong.
Summary: While a popup's opener is navigating from same- to cross-origin, reading window.location.href throws while window.history.back() still works → As a popup's opener is navigating from same- to cross-origin, reading window.location.href throws while window.history.back() still works
(In reply to Justin Lebar [:jlebar] from comment #0) > The fact that this does something indicates that opener.location.href stops > working before opener.history.back() stops working. Which is probably a bug. Does opener.history.back() ever stop working? In step 3 of the manual testcase, I can call opener.history.back() long after opener.location.href is blocked by XOW. Does it matter for cross-origin access guards which window is the opener? I thought as long as a window had a reference to another one, it could call any properties exposed by IsPermitted, but I may be mistaken.
Oh, I fail at using my confusing manual testcase. You're totally right. Sorry about that!
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → INVALID
Group: core-security
You need to log in before you can comment on or make changes to this bug.