How to disable popups in Firefox without add-ons?

06
2014-04
  • Dog

    For the past 5-10 years or so, I've been using Firefox, and I've never found out how to properly disable popups. I am now using Firefox 24.2.0 on Linux without Flash or Java. I used to just disable JavaScript, which seemed to work (at least for sites that don't need JavaScript), but new versions of Firefox remove that feature. I find the dominating time I waste during any day is on closing popup windows. I typically get 10-500 popups per day. I've heavily used some 40 computers over the last years, all with various versions of Linux and Windows, and in various locations (home/work/school) and I've always had the same problem. So it doesn't seem to be a malware issue.

    All these years, I always checked the "Block pop-up windows" button: enter image description here

    But it seems this doesn't do what I want it to. For example this page just showed a popup window when I clicked on the description. Also this page shows a popup when I click on the description or file name. I sometimes even get pages that show 4-10 popup windows.

    Maybe I'm using the wrong option to disable popups? What does this option that I turned on actually do?

  • Answers
  • and31415

    Firefox settings

    Many settings, especially the most advanced ones, are not present in the User Interface (UI) options dialog.

    Preference settings that are modified from default values are saved in the prefs.js file. Instead of directly editing this file, recent Mozilla applications include a configuration editor that can be accessed from the application interface.

    Source: Editing configuration

    In Firefox, type about:config in the Location Bar (address bar) and press Enter to display the list of preferences [...]. If you see a page with the warning message, "This might void your warranty!", click the button labeled "I'll be careful, I promise!", to continue (in fact, there is no warranty whatsoever, it's more a joke to ensure that users are aware of what they are about to do). Use the checkbox there to avoid the warning in the future.

    To add a new preference, context-click (right-click) anywhere in the list of preferences. In the context menu, select New then select the type of preference you are adding.

    To modify an existing preference, context-click (right-click) on the preference, select Modify and type in the new value.

    To reset a preference to its default value or to remove an added preference, context-click (right-click) on the preference and select Reset.

    You can use the Search bar at the top of the about:config page to filter the preferences that you want to inspect. The search bar is case-insensitive, unlike the actual configuration variables.

    Source: about:config

    Pop-up related preferences

    Here's a comprehensive list I've come up with:

    • browser.link.open_newwindow

      Type Integer
      Default value 3

      Description Controls where to open links that would normally open in a new window. Possible values:

      • 1 (or anything else) - open in the current tab or window.
      • 2 - open in a new window.
      • 3 - open in a new tab.


      Enabling or disabling the Open new windows in a new tab instead UI option will toggle this preference between 3 and 2.

    • browser.link.open_newwindow.restriction

      Type Integer
      Default value 2

      Description Restricts all new windows opened by JavaScript. Possible values:

      • 0 - always force new windows into tabs.
      • 1 - don't restrict new windows.
      • 2 - force windows that don't specify their features (e.g. width, height) into tabs.

    • browser.popups.showPopupBlocker

      Type Boolean
      Default value true

      Description Determines whether to show an icon in the status bar when a pop-up has been blocked. Obsolete, just leave it as-is.

    • dom.disable_open_click_delay

      Type Integer
      Default value 1000

      Description Handles pop-ups according to the current pop-up blocker settings when created through a JavaScript timing event using a delay smaller than this value (in milliseconds).

    • dom.disable_open_during_load

      Type Boolean
      Default value true

      Description When enabled, blocks pop-ups created while the page is loading. This setting is equivalent to the Block pop-up windows UI option.

    • dom.disable_window_flip

      Type Boolean
      Default value true

      Description Determines whether windows can be focused through JavaScript.

    • dom.disable_window_move_resize

      Type Boolean
      Default value false

      Description Determines whether windows can be moved or resized using JavaScript.

    • dom.disable_window_open_feature.*

      Description Rather than a single preference, this is a set of different boolean settings which can prevent a specific pop-up feature (e.g. address bar, scroll bars, etc.) from being disabled when set to true. Available preferences:

      • dom.disable_window_open_feature.close
      • dom.disable_window_open_feature.location
      • dom.disable_window_open_feature.menubar
      • dom.disable_window_open_feature.minimizable
      • dom.disable_window_open_feature.personalbar
      • dom.disable_window_open_feature.resizable
      • dom.disable_window_open_feature.scrollbars
      • dom.disable_window_open_feature.status
      • dom.disable_window_open_feature.titlebar
      • dom.disable_window_open_feature.toolbar

    • dom.disable_window_status_change

      Type Boolean
      Default value true

      Description When enabled, prevents the status bar text from being changed via JavaScript.

    • dom.popup_allowed_events

      Type String
      Default value change click dblclick mouseup reset submit touchend

      Description A space-separated list of the events allowed to create pop-ups. Although undocumented, setting the value to a single space character will create an empty list, thus disabling all pop-ups (exceptions still apply). The same effect can be achieved by specifying a non-existent event (e.g. none).

    • dom.popup_maximum

      Type Integer
      Default value 20

      Description Limits the number of simultaneously open pop-up windows.

    • privacy.popups.disable_from_plugins

      Type Integer
      Default value 2

      Description Controls pop-ups created by plug-ins (e.g. Adobe Flash Player). Possible values:

      • 0 - no restrictions.
      • 1 - limits the pop-ups number to dom.popup_maximum.
      • 2 - block all pop-ups except for whitelisted websites.
      • 3 - block all pop-ups.

    • privacy.popups.policy

      Type Integer
      Default value 1

      Description Deprecated. Use dom.disable_open_during_load instead.

    • privacy.popups.showBrowserMessage

      Type Boolean
      Default value true

      Description Determines whether to display an information bar whenever one ore more pop-us are blocked. Can be changed by using the Don't show info bar when pop-ups are blocked UI option.

    • privacy.popups.usecustom

      Type Boolean
      Default value true

      Description Apparently unused.

    Recommended settings

    These are the values I currently use for the settings listed above; feel free to experiment with other settings on your own. Tested with Firefox 27.0.1.

    browser.link.open_newwindow;3
    browser.link.open_newwindow.restriction;0
    browser.popups.showPopupBlocker;true
    dom.disable_open_click_delay;1000
    dom.disable_open_during_load;true
    dom.disable_window_flip;true
    dom.disable_window_move_resize;true
    dom.disable_window_open_feature.close;true
    dom.disable_window_open_feature.location;true
    dom.disable_window_open_feature.menubar;true
    dom.disable_window_open_feature.minimizable;true
    dom.disable_window_open_feature.personalbar;true
    dom.disable_window_open_feature.resizable;true
    dom.disable_window_open_feature.scrollbars;true
    dom.disable_window_open_feature.status;true
    dom.disable_window_open_feature.titlebar;true
    dom.disable_window_open_feature.toolbar;true
    dom.disable_window_status_change;true
    dom.popup_allowed_events; 
    dom.popup_maximum;20
    privacy.popups.disable_from_plugins;2
    privacy.popups.policy;1
    privacy.popups.showBrowserMessage;false
    privacy.popups.usecustom;true
    

    Further reading


  • Related Question

    Firefox popup blocker filtering exceptions
  • Chris Marisic

    This might be a dumb question but what exactly is the filter rule format to globally allow sites? Do I need multiple entries to handle folder structure of the sites and entries to handle subdomains? Is an asterisk used for a wildcard, do I even need to use a wildcard?


  • Related Answers
  • heavyd

    To globally allow a site, just add their base url:

    example.com    Allow
    

    If you just want a subdomain of a site, say their webmail client for exmaple:

    webmail.example.com    Allow
    

    You cannot specifiy a certain directory or page to allow, pop-up rules are all based on the site.

  • nik

    This Mozilla Support page for Pop-up Blocker should be useful.

    Rules are simple -- like heavyd has already described.


    If you want to go beyond that in firefox, you should install the
    AdBlock Plus and maybe NoScript extensions.
    AdBlock Plus will give you lots of flexibility.