How to block mouse-click popups in Firefox - gHacks Tech News

How to block mouse-click popups in Firefox

The majority of popup blockers only block popups that websites and services try to spawn automatically when they load. There are certain browser events that can spawn popups as well, and those are usually not blocked by default.

A very common option is to display a new browser window when you click on a link in the browser. There are others, like double-clicking on links or clicking on a submit button.

When you look at how Firefox handles popups, you will notice that it blocks popups automatically. You find the setting in the Options under Content. Here you can also add exceptions, that is websites that you want to allow popups to be launched on.

Websites and domains that you add here are allowed to display popups. A simple example where this may be appropriate is if you are using WordPress to publish articles. WordPress launches a new window when you click on the upload files button on the add media page. If you disable popups, that window is not displayed preventing you from doing so.

firefox popups

This is not an issue if you are running Firefox with default settings as it is an on-click popup event that is permitted automatically.

What many Firefox users do not know is that you can remove some or all of the exceptions that the browser makes in regards to popups.

Here is the list of events that will spawn popup windows in Firefox even if the popup blocker is enabled:

  • change, click, dblclick, mouseup, reset, submit, touchend

Disabling all popups in Firefox

  1. Type about:config in the browser's address bar and hit the enter key.
  2. First time users need to confirm that they be careful on the next page.
  3. Type or paste dom.popup_allowed_events into the search field.
  4. The value of the preference highlights all events that are allowed to spawn popups.
  5. Double-click the preference and remove some or all of the items here. You can also add some if you want to do so.

firefox allowed popup events

The changes are active immediately in the web browser.

Note: Some websites may use JavaScript or other scripts to detect the blocking of popups. It is then possible that they prevent access to part or all of the site's functionality based on that. You will however receive a blocked popup notification at the top of the browser that gives you options to enable popups on the site.

If you select enable, the domain will be added to the whitelist in the Firefox options.

We need your help

Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.

We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats or subscription fees.

If you like our content, and would like to help, please consider making a contribution:

Comments

  1. fokka said on May 27, 2013 at 10:53 am
    Reply

    thanks! will try it out immediately!

  2. happysurf said on May 27, 2013 at 12:58 pm
    Reply

    Yes, the best popups blocker is already inside Firefox.
    Absolutely perfect.

  3. Hans said on May 27, 2013 at 1:17 pm
    Reply

    Thank you, I’ve been looking for this particular option.

  4. Boris said on May 27, 2013 at 9:17 pm
    Reply

    I have been using these options to block popups for few years, and I still get tons of popups on loading and exiting websites. I get them Mostly on Asian websites. English language websites have different annoayance: popups while clicking on a background. I wish Firefox would provide option: no popups while clicking on background.

  5. EuroScept1C said on May 28, 2013 at 5:31 am
    Reply

    Holy!… Man, thank you!

    So, this is what the JavaScript Pop-up blocker does… sort of, right? Why such golden parameters ain’t as transparent as they should?

    This has been added to my Fx-tweak list; the second… The first was that about prefetch.

  6. fred said on February 6, 2014 at 1:16 pm
    Reply

    It’s going to be a hassle to go back and forth adding and removing click and dbclick from that config property (adding it back when I use a site that actually needs a popup from a click). Making a site-specific whitelist is also a hassle.

    A good solution would be to allow click/dbclick to open a window IF a modifier key is pressed (alt/control/etc.) That way when I need the popup, I just do an alt-click or whatnot. If I don’t want a popup I don’t press the modifier key.

    Why don’t the firefox guys add that?

  7. Paul said on August 15, 2016 at 9:12 am
    Reply

    I don’t understand.

  8. Anonymous said on August 31, 2016 at 5:50 pm
    Reply

    Better use this addon:
    https://addons.mozilla.org/pl/firefox/addon/adblock-plus-pop-up-addon/
    With this you could configure “specific” sites that are using click popups.

  9. Jeff said on October 27, 2016 at 4:27 pm
    Reply

    Thanks, you’re AMAZING!

  10. Anonymous said on February 18, 2017 at 5:55 pm
    Reply

    Works, great tip

  11. Me said on March 31, 2017 at 3:57 am
    Reply

    Thank you

  12. Anonymous said on August 20, 2017 at 3:02 am
    Reply

    Thank you for this. I just tested it out and man it feels real smooth.

  13. Henry said on September 20, 2017 at 12:50 am
    Reply

    Fantastic!….works like a charm…
    The Firefox setting you described protects against user-traps using java script mouse click and mouse-over pop-ups that is used by ad-scammer, infinite-loop malaware code jammers using mouse over content css/js code hiding via html5 or adobe flash.
    all you need to enable is : click, dbclick and submit.

    by the way….did you know, you are killing a million dollar pop-up and ad-syndication of the p**n industry by enabling this setting …. :-) lol

    Well done, Martin…thanks once again.

  14. Aural Arch said on October 20, 2017 at 4:09 am
    Reply

    Is there any list or reference documentation which explains what each possible is? Most of them are obvious, but some are rather ambiguous or cryptic to some of us…

    Thank you so much!

  15. Anonymous said on June 18, 2018 at 3:32 am
    Reply

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

Please note that your comment may not appear immediately after you post it.