A primer to blocking advertisements in Firefox

January 19th, 2010

Before I instruct you on how to block ads, I feel compelled to point out that many web site derive their revenue largely or exclusively from advertisements; if you don’t download the ads, the web site doesn’t get paid. Some see ad blocking as theft. I don’t. But I would be remiss in providing these instructions without providing enough background for you, the reader, to make your own educated choice in the matter.

I will cover two lines of defense against advertisements in Firefox: Adblock Plus and custom stylesheet creation. Each has it’s own strengths and weaknesses. I believe Adblock prevents advertisements from being downloaded, which saves you bandwidth (the tubes don’t get clogged with stuff you didn’t want in the first place) and, as indicated above, the web site potentially loses revenue. With a custom stylesheet, you still download the ads, but Firefox doesn’t show them to you, so the site still makes money off you. I haven’t benchmarked it, but I’ve read that a sufficiently large custom stylesheet will slow down your browser. Slower than an equally large set of Adblock filters? I don’t know.

Once you’ve installed Adblock, you can click on the Adblock Icon. Mine appears in the bottom corner of your browser, but I’ve also seen it next to the search bar. You may have to look around. Click on the icon, wherever find it. It will give you a list of the blockable items on the page. I don’t have any idea what any of them represent, and I don’t know of a speedy way to find out, so I like to block conservatively by scrolling through the list of URLs till I find one that looks like an ad server. For example, on Facebook, the only three of the blockable items with URLs suggesting advertisements all started with http://creative.ak.fbcdn.net/ads3/.

Click on the URL will make it appear in the “New filter” prompt across the bottom. Because it seemed pretty safe to assume that anything in the directory ads3 is an advertisement, I added the following new filter:

The asterisk (*) at the end tells Adblock that it should block anything starting with the given URL.

That blocked all the advertisements’ images, but the text of the ads remained visible. I searched for how to set up a custom stylesheet and manipulate a div on an entire domain, only to find that someone else had already created a much more robust file and installation instructions. Its worth noting that this will download the ads, so the sites you visit will still get paid, and you don’t have to see the ads.

There are couple other ways to block ads, but they require more detailed configuration than I expect the average user to be comfortable with:

  • My favorite is NoScript. It prevents the browser from executing Javascript unless you explicitly tell it to on a site-by-site basis. This breaks most web sites, so it’s not for the faint of heart.
  • Both Windows and Linux (and presumably Mac) have a file listing where to look for certain servers (or hosts). If there’s a domain name you never want to reach again, you can block it in the hosts file. It requires you to add each domain name automatically, so it can be tedious. There are several pre-made hosts files available for download, but I haven’t looked into them to know if they’re any good. I believe the syntax is the same for Linux, Windows and Mac, so if you develop a hosts file you really love, you can take it with you if you change operating systems.

Tags: ,

2 Responses to “A primer to blocking advertisements in Firefox”


  1. Who says:

    I’m Who! I smell!

  2. Pingbacks/Trackbacks