MozillaZine

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

User Help for Mozilla Firefox
Fox666
Guest
 

Post Posted June 7th, 2010, 1:00 pm

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: 8142
Joined: May 7th, 2007, 12:07 pm

Post Posted June 7th, 2010, 2:13 pm

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
 

Post Posted June 7th, 2010, 3:56 pm

Thanks men!

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

Post Posted June 1st, 2011, 2:28 pm

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: 8142
Joined: May 7th, 2007, 12:07 pm

Post Posted June 1st, 2011, 3:30 pm

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

Post Posted June 1st, 2011, 3:59 pm

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

Return to Firefox Support


Who is online

Users browsing this forum: Google [Bot] and 18 guests