I want to disable onbeforeunload in Firefox browser. Don't tell me to disable JavaScript. I just want to disable this dialog box from appearing.

link|improve this question
feedback

migrated from stackoverflow.com Jul 10 '11 at 3:41

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 0 down vote accepted

one thing i do when some annoying website run some stuff like that is overriding the functions. let me give you an example.

in most cases if onbeforeunload has been defined using this method:

window.onbeforeunload = function() {
   ....
}

You can override it using firebug console the same way

window.onbeforeunload = function() {} // blank function

Note: I have encountered some script that use self.close with a timer that is also very annoying for a slow reader like me. here is my solution

window.close = function() {} // blank function

simply override closing the window.

I hope this answers your question

link|improve this answer
I want this feature to be disabled every page i visit – MonsterMMORPG Jul 10 '11 at 16:30
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.