Closed Bug 456447 Opened 12 years ago Closed 11 years ago
.tabs .warn On Close set to true, on Before Unload events are executed before user confirmation that tabs are to be closed
Confirmed on Windows XP that the Quit dialog appears after the alert. This regressed on 15 June 2007 so I assume it was caused by bug 383760.
This will work only if browser.tabs.warnOnClose is set to true (default) AND you close a Firefox window with at least 2 opened tabs.
Summary: onbeforeunload is invocaded too early when you would close firefox with some tab → onbeforeunload is called too early when you close firefox with multiple tabs opened
A better summary could be: onbeforeunload is called before the dialog box of close confirmation
Regression from Firefox 2, we should fix it. Proper behaviour would be to capture the onBeforeUnload event and dispose of it if the user decides to cancel the close. --> Tabbed Browser, but I wonder if this requires docshell work?
Component: General → Tabbed Browser
Flags: blocking-firefox3.1? → blocking-firefox3.1+
QA Contact: general → tabbed.browser
Summary: onbeforeunload is called too early when you close firefox with multiple tabs opened → with browser.tabs.warnOnClose set to true, onBeforeUnload events are executed before user confirmation that tabs are to be closed
Target Milestone: --- → Firefox 3.1
Depends on where the warnOnClose code hooks in. I'd think if that runs early enough there would be no need for docshell stuff...
Connor: another regression from bug 383760, which I've apparently decided is something I need you to help out with :)
Assignee: nobody → mconnor
Priority: -- → P1
It seems like we explicitly changed the ordering to prompt after the onbeforeunload calls in that bug, need to dig further to figure out why that is the case.
Status: NEW → ASSIGNED
Connor tells me he has a patch waiting; please set yourself up with a reviewer, I'd like to get this closed out by tomorrow if possible.
straightforward enough... doesn't fix Bug 474692 but that seems a separate bug, probably longstanding
Attachment #358048 - Flags: review?(gavin.sharp)
Whiteboard: [needs review gavin]
Attachment #358048 - Flags: review?(gavin.sharp) → review+
Whiteboard: [needs review gavin] → [has patch]
Whiteboard: [has patch] → [needs landing]
Checked in, branch and trunk.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [needs landing]
Verified fixed on 1.9.2 and 1.9.1 with: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2b6pre) Gecko/20091222 Namoroka/3.6b6pre ID:20091222033648 Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:184.108.40.206pre) Gecko/20091126 Shiretoko/3.5.6pre ID:20091126031004 Can we get an automated test for it? That shouldn't be too hard.
You need to log in before you can comment on or make changes to this bug.