Block "Are you sure you want to exit this page" pop-up

User Help for Mozilla Firefox
Post Reply
Fox666
Guest

Block "Are you sure you want to exit this page" pop-up

Post by Fox666 »

How do I block the pop-ups that show up that says "are you sure you want to exit this page?"

Usually it show up in advertisement pages, expecially "your computer may be in danger" one... so I really want to completely block it

Thanks! :mrgreen:
Anonymosity
Posts: 8779
Joined: May 7th, 2007, 12:07 pm

Re: Block "Are you sure you want to exit this page" pop-up

Post by Anonymosity »

You could block javascript for those pages, or you could simply disable the onunload and onbeforeunload commands so that they cannot create popup windows by adding these two preferences into about:config.
user_pref("dom.disable_window_onbeforeunload", true);
user_pref("dom.disable_window_onunload", true);
If you really want to disable all possible actions of those commands, you could use a web filtering application to change the commands into nonsense. Proxomitron is such an application.
Fox666
Guest

Re: Block "Are you sure you want to exit this page" pop-up

Post by Fox666 »

Thanks men!
akahige
Posts: 440
Joined: July 16th, 2004, 6:47 pm

Re: Block "Are you sure you want to exit this page" pop-up

Post by akahige »

I'm reviving this old thread because the instructions no longer seem to work using Firefox 4.

Testing using this page: http://www.4guysfromrolla.com/demos/OnB ... dDemo1.htm

Am hoping someone has an updated approach on making this work.
Anonymosity
Posts: 8779
Joined: May 7th, 2007, 12:07 pm

Re: Block "Are you sure you want to exit this page" pop-up

Post by Anonymosity »

That thing that popped up was a message box, not a full-fledged popup window. The dom... commands I think just block popup windows. If you can use BFilter, perhaps you could block that if you made a new filter that substituted a nonsense string for onbeforeunload. Mind you, I have no idea if BFilter will work with Snow Leopard.
akahige
Posts: 440
Joined: July 16th, 2004, 6:47 pm

Re: Block "Are you sure you want to exit this page" pop-up

Post by akahige »

Thanks. That helps clarify why things weren't going as I expected.
Post Reply