WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
18341
window.onunload not fired when the last browser window is being closed
https://bugs.webkit.org/show_bug.cgi?id=18341
Summary
window.onunload not fired when the last browser window is being closed
ptr
Reported
2008-04-07 06:35:13 PDT
We expected that the handler attached to "window.onunload" gets invoked anytime when a document gets unloaded - means for any of following cases you should get same and consistent behavior. (A) Close last browser window (B) Close window, but still have another opened (C) Refresh window (D) Reload window/ put another URL in address bar Wrong behavior with Safari 3.1. (525.31.3) [WinXP/SP2] ------------------------------------------------------ Safari-for-Windows doesn't cover the case (A). When the LAST browser window is being closed, the handler attached to "window.onuload" is not called. Using attached sample, you will not get any alert or window opened for the case (A) at all. The cases (B,C,D) are handled properly. Expected behavior ----------------- MSIE, Firefox or even Safari for Mac 3.1 behaves correctly, in all cases (A,B,C,C) new window and popup gets displayed. Note: Even the scenario may look strange for you - we use the window.onuload to perform reasonable actions (to notify backend servers about to close backend sessions when the user left the browser), so it is not about just annoying popups/windows, but have strong real and valid usecase. I put the severity to Critical as it is almost a blocker for our apps. Can be related to: *
http://bugs.webkit.org/show_bug.cgi?id=12469
Attachments
Testcase for window.onunload bug
(454 bytes, text/html)
2008-04-07 06:38 PDT
,
ptr
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
ptr
Comment 1
2008-04-07 06:38:00 PDT
Created
attachment 20380
[details]
Testcase for window.onunload bug Refresh, reload or close browser window and observe whether the browser is performing onunload actions or not. You should see a new new window and alert displayed.
ptr
Comment 2
2008-04-07 06:57:46 PDT
As the testcase opens new window, make sure you disabled popup blocker before you start testing. (or comment out the "window.open" line completly, stay only with window.alert).
mitz
Comment 3
2008-04-07 08:16:17 PDT
<
rdar://problem/5846165
>
David Kilzer (:ddkilzer)
Comment 4
2008-06-01 08:51:10 PDT
See
Bug 12469
.
Adele Peterson
Comment 5
2008-07-09 14:32:14 PDT
Seems to be fixed in TOT. Please let us know if it still doesn't work for you.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug