Closed
Bug 513566
Opened 15 years ago
Closed 13 years ago
onbeforeunload event fires twice when a popup window is closed by its opener
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 305085
People
(Reporter: duncan.loveday, Unassigned)
References
Details
(Keywords: testcase)
Attachments
(1 file)
691 bytes,
text/html
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2
Given a script that executes w=window.open(...) and then w.close(), the onbeforeunload event in the referenced window fires twice.
Reproducible: Always
Steps to Reproduce:
1. Open the attached test case in window/tab 1.
2. Click "open" - this will open window/tab 2 and load the same document.
3. Switch back to window/tab 1.
4. Click "close" and note the alerts produced.
Actual Results:
In step 4 the alerts I see are "beforeUnload with 1", then "beforeUnload with 2", then "unload with 1". These show that the beforeunload event has fired twice whilst the unload event has fired once.
Expected Results:
Unless there's a reason why beforeunload should fire twice the alerts should be "beforeUnload with 1" followed by "unload with 1".
If instead of steps 3 and 4 you simply close tab 2 then both events fire once as expected.
Reporter | ||
Comment 1•15 years ago
|
||
Reporter | ||
Comment 2•15 years ago
|
||
This is a regression in Firefox 3.5 (OK in 3.0.13).
Keywords: regression
Reporter | ||
Comment 3•15 years ago
|
||
(In reply to comment #2)
> This is a regression in Firefox 3.5 (OK in 3.0.13).
No it isn't, just that I can't follow my own instructions.
Same behaviour on Fx 3.0.13 and 2.0.0.20
Keywords: regression
![]() |
||
Comment 4•14 years ago
|
||
See also bug 531199.
Comment 5•13 years ago
|
||
This is bug 305085.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
Reporter | ||
Comment 6•13 years ago
|
||
I can't reproduce this using Fx 7.0.1. Not 100% sure it is a duplicate of the other bug but it is definitely WFM.
Reporter | ||
Comment 7•13 years ago
|
||
Not a duplicated of 305085 as that bug is still an issue (just tried it) whilst this one is resolved.
Resolution: DUPLICATE → WORKSFORME
Comment 8•13 years ago
|
||
(In reply to Duncan Loveday from comment #7)
> Not a duplicated of 305085 as that bug is still an issue (just tried it)
> whilst this one is resolved.
How do the two bugs differ? They both describe windows with onbeforeunload closed via window.close(); what makes the procedures different?
Reporter | ||
Comment 9•13 years ago
|
||
Josh, you may well be right. I was wrong earlier when I said this was working, was clicking the "Close Tab" icon on the tab header instead of the "Close" button in the document. And the bugs are indeed very similar, the only difference is that mine has the window.close() being invoked from the opener but that may not be significant.
I've set the status back to how you had it, sorry for the misunderstanding.
Resolution: WORKSFORME → DUPLICATE
Assignee | ||
Updated•6 years ago
|
Component: Event Handling → User events and focus handling
Comment 10•4 years ago
|
||
I'm still experiencing this. Is this still in the works?
You need to log in
before you can comment on or make changes to this bug.
Description
•