- Ads and Wasted Space
- The Mechanism
- Filter Lists
- Manual Blocking
- Manual Blocking + 1
- Holy Trinity of Adblocking
- Secure Alternative: RequestPolicy
Are you annoyed with ads, banners and other distractions on webpages? Do some of your favorite websites waste screen space on useless content? Adblock Plus can help, and it certainly doesn't come without backup!
ABP is just what it says on the tin: an adblocker for both Firefox and Chrome. It's currently one of the most popular add-ons around and most people agree that it does a good job out-of-the-box. It removes content based on filter lists that can either be subscribed to for automatic blocking or created manually/semi-automatically. Doing so speeds up page loading, reduces CPU and RAM usage and, most importantly of all, makes your browsing experience much more enjoyable and smoother.
Of course, blocking ads is just one way to put it to use. It can block literally anything you can write a filter for, including various kinds of page content and even scripts. The latter makes it useful as a less aggressive alternative for NoScript with a block-by-blacklist instead of allow-by-whitelist approach.
However, ABP is not flawless. The default configuration is not the most effective and can — paradoxically — create severe performance issues. You might not notice the latter on a powerful computer, but why would you choose to run sub-optimally if you have the option not to? Laptop users in particular will feel the difference a proper understanding of ABP's mechanism can make.
Note that there are many spin-offs of ABP around: Adblock Edge, Simple Adblock, Adblock Lite, Trueblock Plus, etc. I've tried each one and, to be honest, none have given me any reason to prefer them over the original ABP. If anything, they only created new problems that I won't go into here. My recommendation is to stay away from them.
While ABP is the focus of this article, there are various other adblockers available. I won't talk about those because they focus on a small number of large, mainstream websites only. However, I did come across one particular challenger that immediately struck my fancy... More about that one later!
ABP actually consists of two parts: the add-on itself and its filter lists. The former is merely a tool that has the ability to remove chunks of content from webpages. The latter are what tell ABP which content to remove, i.e. they're the hand that wields the tool.
When loading a page, ABP reads and processes each filter in the installed filter lists and blocks any matching page content. Some filters describe only a single element, while others are "open-ended" enough to block dozens of elements at once.
There are 2 kinds of lists: those that you subscribe to and those that you create and maintain manually. Subscription lists are automatically updated and maintained by a community of volunteers with a lead author. These are some of the most popular examples:
- EasyList is the default that blocks ads in general. There are several specialized derivatives of it;
- Adversity offers 2 lists: one for ads and general web tracking, and one to get rid of social networks;
- Fanboy has separate lists for ads, tracking and visual annoyances. Note that Fanboy has moved to EasyList, making these sets a bit redundant.
Each website or webpage usually requires its own, dedicated filters. Because of this, websites that are not frequented by anyone in a list's community will hardly be cleaned. Small, niche websites are unlikely to be supported by your list while large and well-known websites will be practically ad-free.
After a few years of using ABP, I started searching for the source of the constant freezes and memory leaks I was having in my otherwise smoothly running Firefox. EasyList and the other popular filter lists sadly turned out to be the culprits. This is what I found:
- ABP with subscription lists enabled accounted for 40% of Firefox's internal memory usage, roughly 40MB or about the same as Firefox's own code (not to be confused with the total RAM usage as reported by Task Manager and the like, which is around 200MB for me). Removing the lists entirely (disabling them is not enough!) and leaving only the manual lists reduced this to 400KB, which is pretty much the average of all add-ons;
- Firefox reacted much more smoothly and froze much less when loading pages with the lists disabled;
- EasyList contains 37,000 filters at the moment and more are added every week. Only 100 or 200 of those filters had ever had any hits, despite months or years of browsing.
The reason popular filter lists make Firefox slow is because of their size. All filters need to be loaded and possibly applied on each page, which is a gargantuan task. I've found traces of a tree structure in which the individual letters of a filter's domain (if any) form its branches. If that's what's used, then ABP can fairly easily skip groups of filters that have no relevance to the current page, but the overall task of navigating the tree and the sheer number of filters to parse is still huge.
I no longer use EasyList or any other subscription lists. But then, how do I block the stuff I don't want? Keep reading to learn more about how to solve that problem!
After installing ABP, you'll have 2 new context menu entries: "Adblock Image" and "Adblock Frame". The former obviously serves to block specific images, while the latter blocks specific frames. Wait, what are frames?
A frame is essentially a webpage embedded in another, visually similar to the screenshots embedded in this text. One example can be found right here at Gizmo's: the search box. If you enter something into the search box, you'll get a new page with search results from the site. Doesn't the list of results look familiar though? Indeed, it's a Google page! More specifically, it's a Google frame. Go ahead and try it, but don't forget to click Back to return here!
When you hover the cursor over either an image or frame and click the appropriate option, you'll get a window where you can choose from a set of filters that block what you clicked. Each one has its own level of specificness. The top-most filter blocks only the exact thing you clicked while the bottom one blocks everything coming from the entire website. In-between are options that are slightly more and slightly less specific, one resource directory level and domain level at a time.
If you've read the second part of the Basic Mechanics section in my NoScript article, you'll know exactly what to choose in this window. Otherwise, here's a quick tutorial: things like frames and images are loaded from webservers, where they're stored as files in a folder structure. You'll be blocking specific files, folders or entire webservers with these filters.
In the image to the right, encrypted-tbn0.gstatic.com is the server, gstatic.com is its parent domain (Google's, in this case) and images is the entire relevant folder structure. If you choose the top-most option, you'll probably be blocking every image coming from that particular Google server. Choosing to block gstatic.com will block 99% of everything on every server owned by Google.
To make a long story short, try to block exactly that which seems like the source of the unwanted content, nothing more or less. If you see a folder name that suggests it contains everything you don't want, block that folder. If that's not enough, block the server. If even that doesn't suffice, block the entire network/domain. That is also the following order in which the filters are displayed.
|www.example.com/cdn/ads/p.html||ads is a suspicious folder name, the rest seems fine. Block only the ads folder.|
|ads.example.com/cdn/p.html||ads.example.com probably hosts nothing but ads. Block the server ads.example.com.|
|www.adserver.com/cdn/p.html||You probably don't want anything from a domain called adserver.com. Block the whole network.|
You can also manually modify one of these if they just don't cut it. If you wish to learn how (and I recommend that you do), you can read the excellent tutorial on the official website. It will also show you how to block scripts and other "exotic" page content advanced users may want to be aware of.
Once you've made your choice, the filter will be added to one of ABP's manual lists. You can edit or remove it, or add more by opening the appropriate tab in ABP's Filter Preferences window.
Although ABP provides a way to manually select content that needs to be removed, it only works on images and frames. That's hardly sufficient for powerusers. For that purpose, Element Hiding Helper was created!
EHH is a plugin for ABP that allows you to select anything on a webpage and automatically creates a filter for it. Just click "Select Element to Hide" in ABP's menu, hover over what you want to remove, make sure the red selection box is where it should be (there are hotkeys to adjust it) and click when everything looks ok.
In the window that pops up, you can customize the filter you're about to create, though in a much easier way than before. First, select the domain on which the filter should work. Then, simply select the criteria the filter should target. The class, name and id attributes are most useful for this, though you can also select the other ones if left with no choice. Don't worry about messing things up by making the wrong choices: this time, there's a live preview of the filter's effects!
Of course, if you're going to block everything manually, you'll have some work ahead of you.
While trying to find a solution that encompasses everything I've written so far, I decided to use simple but abstract computer logic to dictate an answer. I've had some previous run-ins with this method, such as the Secure/Open/Convenient trade-off, which is another variation of the same basic logic. Put simply, trying to simulate human judgment can be done in 2 ways: accurately, which requires a lot of power, or quickly/easily, which won't be accurate.
EasyList and its alternatives try to accurately block everything, making them an example of the former. I think it's wiser to use the latter approach: use a simpe program to get 90% of the work done quickly, then ask the user to complete the final, negligible 10% of the workload.
So how can this solution be put to use? With Bluhell Firewall! Despite its name, BF is simply a lightweight adblocker. It has no configuration menus or other interfaces and contains a single, very short list of filters based on a contraction of the entire EasyList.
BF will take care of the majority of ads on all websites, but of course it will miss a few. On sites you visit often, you can use ABP+EHH or manual filter writing to take care of the last few eye-sores. It's no more effort than bookmarking a new website and subscribing to its RSS feed. Once it's done, it remains done and you don't need to do it again. On new websites you haven't been to, you'll at least see fewer ads without reduced performance.
Another way to block ads most of the time is through RequestPolicy. Details about it can be found in the section about it in my NoScript article. Put simply, RequestPolicy blocks all 3rd party content on webpages (except that which you allow through a whitelist or click-to-play), including scripts, images and Flash objects. That means any 3rd party advertisements, be it images or Flash animations, will never load, without the need for specific blacklisting and with a perfectly future-safe approach. The only weakness of it is that content from the site itself is not checked, and a certain portion of ads is indeed hosted locally.
Please rate this article: