Closed
Bug 504322
Opened 16 years ago
Closed 15 years ago
window.onbeforeunload doesn't work in FF 3.5
Categories
(Firefox :: General, defect)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: heythere119, Unassigned)
Details
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1) Gecko/20090624 Firefox/3.5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1) Gecko/20090624 Firefox/3.5
window.onbeforeunload does not execute when the browser window is closed. I am using the following javascript to set the onbeforenload action:
window.onbeforeunload = function (e) {
var e = e || window.event;
// For IE and Firefox
if (e) {
e.returnValue = 'Message here';
}
// For Safari
return 'Message here';
};
This code worked in FF 3.0 but no longer works in FF 3.5. The window does not prompt the user for confirmation on closing the window. The function never executes.
Reproducible: Always
Steps to Reproduce:
Closing the browser window after setting window.onbeforeunload.
Actual Results:
Window closes without prompting user for confirmation on closing browser.
Expected Results:
User is prompted for confirmation in closing the window.
This feature worked in FF 3.0 but no longer works in 3.5.
Comment 1•16 years ago
|
||
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.1pre) Gecko/20090711 Shiretoko/3.5.1pre
This works fine for me. Maybe an add-on is causing problems? Please try safe-mode to find out: http://support.mozilla.com/en-US/kb/Safe+Mode
Version: unspecified → 3.5 Branch
WFM on Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1) Gecko/20090624 Firefox/3.5
Reporter | ||
Comment 3•16 years ago
|
||
I just noticed that this only occurs when using tabs. If I close the tab it will not prompt for confirmation, but if I try to 'x' out of Firefox completely, the confirmation is displayed.
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1) Gecko/20090624 Firefox/3.5
Reporter | ||
Updated•16 years ago
|
OS: Windows Server 2003 → All
WFM
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.11pre)
Gecko/20100920 Namoroka/3.6.11pre
Mozilla/5.0 (Windows NT 6.0; rv:2.0b7pre)
Gecko/20100918 Firefox/4.0b7pre
Please test this by disabling extensions one by one.
Let us know if it still appear after disabling all the addons
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•