25 Years of Programming
An open source source for C, C++, OWL, BASIC, MDB, XLS, DOT, and more...
Home   Projects   Sitemap   Search   Blog   Forum+Chat   About Us   Privacy   Terms of Use   Feedback   FAQ   Images   Services   Payments   Humor   Music  

How to block ads from web pages in Internet Explorer and Firefox

Ads are placed on web pages in a variety of ways ranging from simple text links to more technically complicated Flash movies and ActiveX controls.

You can block most ads by turning off (in your browser) the methods web pages use for displaying them.

Other ads can be blocked by prohibiting your browser from fetching them from the third-party ad-serving websites they come from.

Following are methods for preventing the display of advertising. Some are also worthwhile for separate security reasons.

If you're new to Internet Explorer or Firefox and have never explored their security and privacy options dialog boxes, this article tells you where they are. Everyone should try to develop some familiarity with these browser options. The default settings that come with the browser are often not the best ones because they are not as secure as they should be.

There are two methods to block ads:

  1. Block the technologies used to serve them.
  2. Block the advertising networks they come from.

How to block ad-serving technologies

Turn off JavaScript

Probably the largest number of internet ads (including Google AdSense) are displayed using JavaScript. If you turn JavaScript off, the volume of ads you see will be greatly reduced.

The downside is that some sites use JavaScript for other things, so you'll probably find that some sites won't work quite right, and a few might not work at all.

Nonetheless, turning JavaScript off also improves your security because it blocks many of the most common exploits against your browser, so keeping it disabled most of the time is a good idea.

Turn off JavaScript in IE7

In IE7, JavaScript is called "active scripting" (to include Microsoft's VBScript). Go to:

  1. Tools > Internet Options > Security > Internet > Custom Level > (Scripting section) > Active scripting
  2. Set it to Disable
  3. Click OK, OK.

Or, for best security, (at ...Security > Internet), just set the slider for the Internet Zone to High. This turns Active Scripting off, but be aware that it turns off many other insecure features, as well, which may affect the functionality of websites you visit. (See the IE7 security article link at the bottom of this page for more information.) 

Turn off JavaScript in Firefox

  1. Tools > Options > Content > Enable JavaScript = cleared (not checked)
  2. Click OK.

Block popup windows

Many people find popup windows particularly annoying. Both browsers provide popup blockers. Some websites use popup windows for non-advertising purposes, so you might have to create exceptions that allow popups on those sites. Fewer sites use popups than use JavaScript, though.

Popup blocker in IE7

  1. Tools > Internet Options > Security > Internet > Custom Level > (Miscellaneous section) > Use Pop-up blocker = Enable
  2. OK
  3. Now switch to the Privacy tab
  4. Make sure Turn on Pop-up Blocker is checked.
  5. OK

Popup blocker in Firefox

  1. Tools > Options > Content > Block pop-up windows = checked
  2. OK

Disable Shockwave Flash

Flash objects can carry content that is not just annoying if you dislike advertising, but can also be a danger to your PC. It is a good idea to disable Flash by default and only enable it on sites that you trust and where it's needed to do something useful.

One way to disable Flash in both browsers is to not install it in the first place, or to uninstall it.

Disable Flash in IE7

  1. Tools > Manage Add-ons > Enable or Disable Add-ons > Add-ons that have been used by Internet Explorer
  2. Find the following two items. For each, click it and then click Disable:
    • Shockwave Flash Object
    • Shockwave ActiveX Control (if present)
  3. OK

Because you enable and disable Flash in Manage Add-ons, you cannot manage Flash with the Internet Explorer "Security Zones" the way you can with many other settings. Instead, leave Flash disabled most of the time and enable it manually when you need it.

Disable Flash in Firefox

There are at least two Firefox add-ons for blocking Flash:

  • I like NoScript because in addition to disabling Flash, it can also disable JavaScript, Java, and other potentially hazardous types of active content. You decide which sites to allow/disallow, similar to the Internet Explorer "Security Zones" concept, except that allowing and disallowing sites is quicker and easier in NoScript. It shows you a list of sites putting active content on the page you are currently viewing, and you can allow/block each of those, too, so it's more informative, more thorough, and more interactive. 
  • The FlashBlock plug-in appears to have the single purpose of blocking Flash. I have not used it myself.  

Disable ActiveX

ActiveX has even greater abuse potential than Flash, and should be disabled by default, except on sites that you trust and where it's needed.

Disable ActiveX in IE7

  1. Tools > Internet Options > Security > Internet > Custom Level > (ActiveX controls and plug-ins section)
  2. Set all 10 items in this section to Disable.
  3. Or, set Internet Zone security to High as described above.

Disable ActiveX in Firefox

By default, Firefox has no ability to run ActiveX, which is a primary reason it used to be called a "safer" browser than Internet Explorer.

If there are plug-ins that allow Firefox to run ActiveX, simply don't install them.

Disable image display

This is really overkill, but if the only thing you want to see on web pages is the text, this will do the job. On dial-up internet access, pages will load much faster.

Disable images in IE7

  1. Tools > Internet Options > Advanced > (Multimedia section) > Show pictures = cleared (not checked)

Disable images in Firefox

  1. Tools > Options > Content > Load images automatically = cleared (not checked)
  2. Or, on the Web Developer Toolbar (if installed), you have two options:

    Images > Disable Images > [All Images] or [External Site Images]

External Site Images by itself doesn't block images fetched by JavaScript or inside an iframe. The iframe is an independent frame (considered a separate web page), so its images aren't "external" to that page.

That covers the "technologies" you can disable in order to block ads. The next section shows ways to block ads based on their origin.


How to block ad-serving networks

You can tell your browser not to fetch any content (the ads) from specific advertising networks that serve them. Both of the following methods require entering the web addresses of the networks to block. The cookies article linked at the bottom of this page has the names of some networks.

These methods block ads that are in iframes.

IE7 Content Advisor (works for IE7 only)

Content Advisor is usually thought of as a way to prevent children from navigating directly to websites, but you can also use it to block third-party advertising on sites.

  1. Determine the ad networks you want to block.
  2. Launch IE7 under an Administrator account, which is required for changing Content Advisor settings. If you are logged into a Limited account, you can do it this way:

    start > All Programs > Internet Explorer > (right-click) > Run as... > (enter your Administrator account name and password).

    IE7 will then launch as if you were logged in as that Administrator.
     
  3. Go to Tools > Internet Options > Content > Settings > (enter password; use one here that is different from ones you use anywhere else) > Approved Sites
  4. Enter the web address of the network you want to block. Use wildcards to block subdomains. For example: *.adnetwork.com/*
    • Prefixing the URL with http:// seems to be optional.
    • The trailing /* means block all pages of the site.
  5. Click Never
  6. OK
  7. Back at Content Advisor, click the Enable button, enter password, click OK.

Subsequently, when you load a web page, there is just blank space in the slot where the ad would be, and Content Advisor pops up a notification that the content was blocked, giving you the option of showing it if you enter the password.

One serious disadvantage of using Content Advisor (for anything) is that while it's enabled, the normal IE7 right-click option "Save Target As..." and others are disabled and grayed out, with no way to enable them, so you are blocking more than just ads.

Internet Security Suite website access controls (any browser)

Trend Micro Internet Security has a feature called Web Site Access Controls. To block an advertising network, open the program's Main Console and go to:

  1. Internet & Email Controls > Web Site Access Controls > Settings > Blocked Web Sites > Add > Add a Web site
  2. Enter the full URL of the network you want to block. It should start with http:// (or an equivalent protocol prefix), followed by the domain name. To block subdomains, use a wildcard. For example: http://*.adnetwork.com
  3. Include all pages of these Web sites = checked
  4. OK

Subsequently, when you load a web page, the slot where the ad would be contains a notification that the content was blocked. It's ugly, but it does the trick.

Other internet security suites probably offer a similar feature.

Plain text links

I don't know of any way to block text link ads, although commercial or plug-in ad blocking software might be able to do it, by stripping out the hyperlink attached to the text before the page is displayed.


Related articles:


Questions and comments are welcome in the forum.


 

Valid HTML 4.01 Transitional
Yahoo! Search
Search the web Search this site
Valid CSS