opera.extension.urlfilter.block.remove()

By Opera Software

From Opera 15 onward, Opera 11 & 12’s extension format is no longer supported, and instead, we’ve switched to Chromium’s extension model. Check out our new documentation for developing extensions for Opera 15 and higher and start building your own extensions.

Description:

Removes a rule from the virtual list of blocked URLs.

Parameters:

  • rule: The rule (e.g. domain) to block.

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]);
}

This article is licensed under a Creative Commons Attribution 3.0 Unported license.

Comments

No new comments accepted.