RESOLVED INVALID 134726
window.opener shouldn't change even when the frame is navigated
https://bugs.webkit.org/show_bug.cgi?id=134726
Summary window.opener shouldn't change even when the frame is navigated
Ryosuke Niwa
Reported 2014-07-08 09:17:16 PDT
http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2014-July/297135.html starting from http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2014-March/253865.html When a window is opened by a frame A and then it's navigated to another page by frame B, then the new window's opener should still point to A per the specification.
Attachments
Bob Owen
Comment 1 2014-07-09 12:21:11 PDT
I think this might just be a matter of adding an |if (created) { }| around https://trac.webkit.org/browser/trunk/Source/WebCore/page/DOMWindow.cpp?rev=142755&order=name#L1887 Although, it could well be more complicated and involve more places in the code.
Sam Weinig
Comment 2 2014-07-09 12:32:07 PDT
(In reply to comment #0) > http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2014-July/297135.html > starting from http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2014-March/253865.html > > When a window is opened by a frame A and then it's navigated to another page by frame B, > then the new window's opener should still point to A per the specification. I'm having a bit of rough time figuring out who is navigating who in this. Can someone attach a test case?
Ryosuke Niwa
Comment 3 2014-07-09 12:35:06 PDT
(In reply to comment #2) > (In reply to comment #0) > > http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2014-July/297135.html > > starting from http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2014-March/253865.html > > > > When a window is opened by a frame A and then it's navigated to another page by frame B, > > then the new window's opener should still point to A per the specification. > > I'm having a bit of rough time figuring out who is navigating who in this. Can someone attach a test case? The test case is in http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2014-July/297135.html: http://fiddle.jshell.net/t4sgd/show/ Chrome and Firefox alert "true"; IE alerts "false". The spec says "false" should be alerted. -Boris
Ryosuke Niwa
Comment 4 2016-04-11 00:32:18 PDT
Chris, did we fix this issue?
Chris Dumez
Comment 5 2016-04-11 08:37:31 PDT
(In reply to comment #4) > Chris, did we fix this issue? No we did not. The behavior is still the same in Safari Technology Preview. That said, no other browser (besides Edge) seems to have implemented this either.
Ryosuke Niwa
Comment 6 2016-04-11 13:27:02 PDT
Ahmad Saleem
Comment 7 2022-08-08 16:47:38 PDT
Here are updated test results: Test Case Link (Updated) - https://jsfiddle.net/t4sgd/show/ ** Safari 15.6 on macOS 12.5 ** Clicking on "Click me first" leads to opening in about:blank in background and then clicking on "Click me second" leads to opening another about:blank in background but show "true" dialog ** Chrome Canary 106 ** Clicking on "Click me first" leads to opening in about:blank in foreground (have to focus back to test case) and then clicking on "Click me second" leads to opening another about:blank in foreground but show "true" dialog upon checking back on test case similar to Safari ** Firefox Nightly 105 ** Clicking on "Click me first" leads to opening in about:blank in foreground (have to focus back to test case) and then clicking on "Click me second" leads to opening another about:blank in foreground but show "true" dialog upon checking back on test case similar to Safari ___________ NOTE - All browsers show "true" for the test case but Safari open the iframe or tabs in background while other in foreground. It might be browser preference or settings but just wanted to share updated results. Thanks!
Ryosuke Niwa
Comment 8 2022-08-10 14:30:32 PDT
The spec has since changed to match Gecko / WebKit at this point.
Note You need to log in before you can comment on or make changes to this bug.