Prevent pop-up windows / ads with Mozilla 0.9.1+.

Technical Q&A involving operating systems, networking, software, and hardware issues.

Moderator: jasonb

Post Reply
User avatar
jasonb
Site Administrator
Posts: 105
Joined: Tue Apr 22, 2003 1:54 pm
Location: Toronto, Canada
Contact:

Prevent pop-up windows / ads with Mozilla 0.9.1+.

Post by jasonb »

If you are using Mozilla 0.9.1+ you can create an entry in your prefs.js file, in your profile directory, which will block sites from "popping up" new windows. Mostly these are advertisements which do nothing other than cause an annoyance.

To block out all pop-ups add the following line to your prefs.js file:

user_pref("capability.policy.default.Window.open", "noAccess");

Make sure that Mozilla is not running when you do this.

For more information, as well as other options such as blocking only specific sites, or allowing specific sites through a global block, see the following:

http://www.mozilla.org/projects/securit ... olicy.html

Presumably this will also work with Netscape 6.1 PR 1 and higher.

UPDATE:

The above reference Web site has out of date syntax for allowing a specific site through a global block. If you do want to let a certain site show a pop-up use the following syntax:

user_pref("capability.policy.allowpopups.Window.open", "sameOrigin");
user_pref("capability.policy.allowpopups.sites", "http://www.site1.com http://www.site2.com");

Each site is separated by a space.
Post Reply