Closed
Bug 1012573
Opened 11 years ago
Closed 11 years ago
window.onbeforeunload not working
Categories
(Core :: DOM: Events, defect)
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: educielo0604, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0 (Beta/Release)
Build ID: 20140518004002
Steps to reproduce:
window.onbeforeunload = function () {
alert("Hello I'm a Bug!");
};
Actual results:
alert doesn't show. function doesnt executes
Expected results:
show an alert saying "Hello I'm a Bug!"
Comment 1•11 years ago
|
||
Working, but you try use alert(), which is blocked in most cases, like other pop-ups (https://bugzilla.mozilla.org/show_bug.cgi?id=969787). Try using just console.log:
window.onbeforeunload = function () {
console.log("Hello I'm a Bug!");
};
But I see that still in some cases alert() is supported when use window.onbeforeunload.
And read this solution:
http://stackoverflow.com/questions/16517284/onunload-alert-error-ns-error-not-available
Comment 2•11 years ago
|
||
This is intended, see Bug 391834 and
https://developer.mozilla.org/en-US/Firefox/Releases/17/Site_compatibility#DOM
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
how about ajax request onbeforeunload event, will they fire?? because in my scenario, it doesn't fire in my controller. it doesn't fire the ajax request
in my scenario, it's quite weird. when i put breakpoints on the developer tools, the request is sent, and the whole process is executed, but when i don't use the developer tools, it doesn't goes to the controller.
You need to log in
before you can comment on or make changes to this bug.
Description
•