Blocking Adverts In Opera

Opera 9 has added a solid ad banner blocker, under the guise of a generic "content blocker". (This indirect name is presumably only there to keep a good corporate image.) To block an ad (either an image, frame, or Flash animation), right-click an empty spot on the page and choose Block content. Then, simply click the banners which you want to block. When finished, click Done in the pseudo-toolbar that appears at the top of the page.

By default, this tries to use some logic to block all ads from the source, but this may sometimes be overkill. To correct this, click the image again (to unblock it), then Shift-click it. This will add only the specific image to the filter list. This filter can then be broadened by clicking Edit.

A filter will typically contain asterisks ('*'). These mean "any number of any characters", much like in filenames for operating systems.

Blocking Flash in Opera 9 see: [http://operawiki.info/FlashBlock#Opera9]

Before Opera 9

The rest of this page is not necessary for Opera 9 but is kept here for archival purposes and extra background information.

There are several methods to block annoying content in Opera (also remember that powewrful third-party options are available). The two principle ways involve using UserCSS to turn off the display of the unwanted content, or Opera's native content filter. The disadvantage of Opera's filter is that you must restart Opera before your changes kick in. To selectively block Flash, have a look at FlashBlock.

Using Automated CSS Blocking

There are several versions of helper applications that allow an image or object to be right-clicked, and its address to be added to a CSS blocklist. Opera then reloads the CSS blocklist. See OperaAdblock for more information. They require manual installation.

Some premade CSS block files are also available; for example from here.

Using the Built-in URL Filter

Although Opera has no GUI method to control blocking ad banners, it is possible to block web sites through editing a configuration file, filter.ini (see OperaAdFilter? for an automated tool for this). If you want to set this up manually, do the following:

; filter.ini
; This file is part of the Opera browser.
[prefs]
prioritize excludelist=1
[include]
*
[exclude]
http://ad.*
http://ads.*
http://adserv*
http://imgserv.ad*
http://*.ads.*
http://*/ads/*
http://*banner*
http://*Banner*
http://count*
http://par.ad.*
http://*linkexchange*
http://*.doubleclick.net/*
http://*.fastclick.net/*
http://*.burstnet.com/*
http://*.hitbox.net/*
http://*.ivwbox.de/*
http://*.tradedoubler.*
http://view.atdmt.com/*
http://pop.mircx.com/*
URL Filter File=/path/to/filter.ini

You will need to edit filter.ini and add the URL fragments from ad servers you encounter. You can use * to replace a number of characters and ? to replace a single character.

To make it easier to add new addresses to your filter.ini, you can edit your right-click menu to copy the address of a banner and open filter.ini in a text editor. To do this (read EditingINIFiles for a tutorial on editing your menu), edit your [Image Popup Menu] section and add the following (change the paths to fit your system:

Item, "Add to block list" = Copy image address & Execute program,"C:\WINNT\notepad.exe","C:\Path\To\Your\filter.ini"

note: Versions prior to V7.5 had a bug with javascript that would hang the page.

Using User JavaScript

With the advent of Opera 8, the new User JavaScript feature can be used to block virtually any ad or pop-up (including DHTML ones!). However, to use this feature, you must have a fundamental understanding of JavaScript, and a keen understanding of web script debugging.

To install some pre-defined, well-written Opera User JavaScripts? for blocking ads and pop-ups, visit Arve's UserJS.org -- specifically, see the Site Enhancements and Site Fixes sections.

Other Options?

OperaAdFilter? - a freeware utility that requires no advanced knowledge to use the filter.ini. Easy to use, plus you can download the latest blocked server/path lists from the web directly inside the program, vist: http://www.operaadfilter.com/. Another program to try is Opera Tools.

For much more comprehensive blocking, with many other advanced features, including debugging features, use a dedicated personal web proxy program like TheProxomitron. No browser-based solution/extension can match the sheer power of this dedicated filtering software. Another good choice is Ad Muncher.

Another cross-browser solution for blocking ads is to use a proxy automatic configuration (.pac) file. For details and examples of how to setup a pac file, visit John R. Lo Verso's site, or PC Magazine

One of the most common ways to block ads is by using a HOSTS file to send ad server web requests to a network 'black-hole'. See http://www.hosts-file.net/downloads.html for information on how to do this, as well as details on many other ways to block ads.

There is also a list of ad servers available that can be viewed in any of the formats mentioned above:

Some examples of the types of file the list can be viewed as:

Block Audio Flash Ads

http://virtuelvis.com/archives/2005/04/flashmute

Categories

CategoryTutorial CategoryOpera

Back Links:
There are 11 comments on this page. [Display and/or add comments]