Closed
Bug 370096
Opened 19 years ago
Closed 19 years ago
onbeforeunload doesn't work when closing tab/window
Categories
(Camino Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
Camino1.6
People
(Reporter: MatsPalmgren_bugz, Assigned: stuart.morgan+bugzilla)
References
()
Details
(Keywords: fixed1.8.1.8, Whiteboard: [camino-1.5.2])
Attachments
(1 file, 1 obsolete file)
|
13.61 KB,
patch
|
mikepinkerton
:
superreview+
|
Details | Diff | Splinter Review |
onbeforeunload doesn't work
STEPS TO REPRODUCE
1. load URL (testcase from bug 284596)
2. type Cmd+W or Cmd+Q
ACTUAL RESULT
Window is closed without any popup dialog appearing
EXPECTED RESULT
popup dialog appears giving the user a chance to veto the close/quit.
PLATFORMS AND BUILDS TESTED
Camino trunk debug build, a few days old, on MacOSX 10.4.8
| Reporter | ||
Updated•19 years ago
|
OS: Linux → Mac OS X
Hardware: PC → Macintosh
| Assignee | ||
Comment 1•19 years ago
|
||
Fixing summary. It works if you navigate away from the page, just not if you close the tab/window. Are there embedding hooks we can to tie into to give handlers a chance to run?
Component: Tabbed Browsing → General
QA Contact: tabbed.browsing → general
Summary: onbeforeunload doesn't work → onbeforeunload doesn't work when closing tab/window
Happens on branch, too.
Version: Trunk → unspecified
| Assignee | ||
Updated•19 years ago
|
Assignee: nobody → stuart.morgan
| Assignee | ||
Comment 4•19 years ago
|
||
Adds a CHBV method to check onunload events, and sets up the chrome to call it whenever closing tabs or windows. I also renamed BW's confusingly-named |windowClosed| method, which has always just really meant that the browser view was closed, since that drove me crazy while figuring out how to wire this up.
Attachment #275428 -
Flags: review?(joshmoz)
| Assignee | ||
Updated•19 years ago
|
Target Milestone: --- → Camino1.6
| Assignee | ||
Comment 5•19 years ago
|
||
Er, s/onunload/onbeforeunload/.
Attachment #275428 -
Flags: review?(joshmoz) → review+
| Assignee | ||
Updated•19 years ago
|
Attachment #275428 -
Flags: superreview?(mikepinkerton)
Comment 6•19 years ago
|
||
+ // Check all the winodws to see if any have tabs that shouldn't be closed.
fix typo.
+ NSArray* openWindows = [[[NSApp orderedWindows] copy] autorelease];
why copy? i don't see anything in here that changes the list while we're iterating.
+ int numTabs = [self numberOfTabViewItems];
const int?
looks good otherwise.
| Assignee | ||
Comment 7•19 years ago
|
||
Comments addressed. Also fixes an early return I missed in applicationShouldTerminate that would skip onbeforeunloads if the general quit warning pref were off. It looks like a lot more change in MainController than it really is, since it's just reparenting a lot of existing code into an |if ([prefManager getBooleanPref:"camino.warn_when_closing" withSuccess:NULL])|.
Attachment #275428 -
Attachment is obsolete: true
Attachment #278205 -
Flags: superreview?(mikepinkerton)
Attachment #275428 -
Flags: superreview?(mikepinkerton)
Comment 8•19 years ago
|
||
Comment on attachment 278205 [details] [diff] [review]
v2
sr=pink
Attachment #278205 -
Flags: superreview?(mikepinkerton) → superreview+
| Assignee | ||
Comment 9•19 years ago
|
||
Landed on trunk and MOZILLA_1_8_BRANCH.
Since this is a web compat issue, we should consider this for 1.5.2 (if it can reasonably be backported).
Flags: camino1.5.2?
| Assignee | ||
Comment 11•19 years ago
|
||
I'd like to see this bake for a little while, just to be safe, so it depends when we do 1.5.2
Stuart, are you satisfied with the baking now? (Unfortunately, the hunk in MainController doesn't apply on the 1_5 branch; it'll need a little massaging because of the exceptions change.)
| Assignee | ||
Comment 14•19 years ago
|
||
Landed on CAMINO_1_5_BRANCH.
Whiteboard: [camino-1.5.2]
You need to log in
before you can comment on or make changes to this bug.
Description
•