Opera Add-ons

Extensions and themes for the Opera desktop browser

Developers: enjoy our new URL Filter API

,

Opera launched a new snapshot of Opera (experimental build) for the more courageous of you to play with.

It includes a small gem for extension developers: a brand new API that makes the world of content blocking a whole lot easier. Here's how it works (non-developers, look away):

First, add this to you config.xml:
<feature name="opera:urlfilter"/>

Then knock yourself out in the background script:
var sites = ['*://twitter.com/*',  '*://*.twitter.com'];  
var filter = opera.extension.urlfilter;

for (var i = 0; len = sites.length; i < len; i++) {
    filter.block.add(sites[i]);
}

On dev.opera.com you can find more developer information on how to use the URL Filter API. For general information on how to develop Opera extensions take a look at this overview.

Not a developer? Here's a photo of a cat.

Another catalog update!Recommended extension awards

Comments

timmi Friday, March 11, 2011 1:24:57 PM

A question on the prozedure for new apis and than new extension versions:

As example imagine there is a adds remover as extension available for opera 11.0. Now the developer migrates his extension to this new api, but now the extension did not work anymore with 11.0. When submitting this extension for 11.1, will the older extension version remain for 11.0?

Arnstein Teigenespirobind Friday, March 11, 2011 2:41:56 PM

@Iwiczek: Not sure if I follow. Blocked content will not be loaded. Divs (and other tags) can be removed using CSS or JavaScript.

@timmi: yes:)

Arnstein Teigenespirobind Friday, March 11, 2011 3:00:18 PM

@Iwiczek: yes it's possible but not as a function of the APIs. It's up to the extension developers to implement the collapsing of block content.

Arnstein Teigenespirobind Friday, March 11, 2011 4:21:25 PM

Bottomline, fullblown adblock in Opera. smile

ouzowtfouzoWTF Friday, March 11, 2011 6:02:20 PM

A nice first step.
Seems like in the future I can add filters permanently to the urlfilter.ini, without having to add them manually every time I download a new filter?!
I hope Opera will be changed, so that one can use regex filters in urlfilter.ini. Would be easier for the makers of filterlists if Firefox, Chrome and Opera could use the same lists.

Daniel HendrycksDanielHendrycks Friday, March 11, 2011 10:23:51 PM

Originally posted by addons:

Not a developer? Here's a photo of a cat.


up

timmi Saturday, March 12, 2011 8:46:15 AM

Second question as a developer: How long should we support old(er) opera versions.

When 11.10 comes out, there are two opera versions to maintain and test and in the future there are more and more new opera versions, its getting more and more work to test all versions, so at a time, a developer might stop maintaining a older opera version, but when is the right time point?

I've two similar ideas for that:
- a global list how many extensions run on specific versions of opera (gathering data through autoupdate?)
- a extension specific list where the developer could see how many users with specific opera versions are using his extension. (although the data from autoupdate?)

anything in planing for that problem?

Arnstein Teigenespirobind Monday, March 14, 2011 11:37:01 AM

@timmi: good suggestions. Can't promise anything but we're investigating it:)

Write a comment

New comments have been disabled for this post.