« Documentation Home

opera.extension.urlfilter.block.remove()

This documentation relates to Opera's now deprecated .oex Extension API framework for Opera versions <= 12.15 and also provided by our OEX2NEX shim library.

For the latest Opera Extensions API documentation for Opera versions > 12.15 please consult the latest Opera Extensions API documentation online.

Description:

Removes a rule from the virtual list of blocked URLs (blacklist).

Note that allowed rules have priority over blocked rules.

Parameters:

Syntax:

void remove (<DOMString> rule)

Example:

<!-- 
  The configuration file ('config.xml').
-->
<?xml version='1.0' encoding='utf-8'?>
<widget xmlns="http://www.w3.org/ns/widgets">
    <feature name="opera:urlfilter"/>
</widget>
//
// The background process (e.g. index.html) 
//

var whitelist = ['http://opera.com/*', 'http://*.opera.com/*'];

// Assign the URLFilter object to a variable for efficiency
var filter = opera.extension.urlfilter;

// Loop through the array of sites and remove each one from the "block" list
for (var i = 0, len = whitelist.length; i < len; i++) {
  filter.block.remove(whitelist[i]);
}