Developers: enjoy our new URL Filter API
By Arnstein Teigenespirobind. Friday, March 11, 2011 10:09:46 AM
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.







timmi # Friday, March 11, 2011 1:24:57 PM
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
@timmi: yes:)
Arnstein Teigenespirobind # Friday, March 11, 2011 3:00:18 PM
Arnstein Teigenespirobind # Friday, March 11, 2011 4:21:25 PM
ouzowtfouzoWTF # Friday, March 11, 2011 6:02:20 PM
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:
timmi # Saturday, March 12, 2011 8:46:15 AM
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