Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6059)

Unified Diff: chrome/common/extensions/docs/declarative.html

Issue 10392127: Move declarative API into events API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix change schema type reference from 'Event' to 'events.Event' Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/declarative.html
diff --git a/chrome/common/extensions/docs/declarative.html b/chrome/common/extensions/docs/declarative.html
deleted file mode 100644
index c21a1183ab1b4fdccf1926765c3d985f13b1d3d6..0000000000000000000000000000000000000000
--- a/chrome/common/extensions/docs/declarative.html
+++ /dev/null
@@ -1,1314 +0,0 @@
-<!DOCTYPE html><!-- This page is a placeholder for generated extensions api doc. Note:
- 1) The <head> information in this page is significant, should be uniform
- across api docs and should be edited only with knowledge of the
- templating mechanism.
- 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a
- browser, it will be re-generated from the template, json schema and
- authored overview content.
- 4) The <body>.innerHTML is also generated by an offline step so that this
- page may easily be indexed by search engines.
---><html xmlns="http://www.w3.org/1999/xhtml"><head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css">
- <link href="css/print.css" rel="stylesheet" type="text/css" media="print">
- <script type="text/javascript" src="../../../third_party/jstemplate/jstemplate_compiled.js">
- </script>
- <script type="text/javascript" src="../../../../third_party/json_minify/minify-sans-regexp.js">
- </script>
- <script type="text/javascript" src="js/api_page_generator.js"></script>
- <script type="text/javascript" src="js/bootstrap.js"></script>
- <script type="text/javascript" src="js/sidebar.js"></script>
- <meta name="description" content="Documentation for the chrome.declarative module, which is part of the Google Chrome extension APIs."><title>chrome.declarative - Google Chrome Extensions - Google Code</title></head>
- <body> <div id="devModeWarning" class="displayModeWarning">
- You are viewing extension docs in chrome via the 'file:' scheme: are you expecting to see local changes when you refresh? You'll need run chrome with --allow-file-access-from-files.
- </div>
- <div id="branchWarning" class="displayModeWarning">
- <span>WARNING: This is the <span id="branchName">BETA</span> documentation.
- It may not work with the stable release of Chrome.</span>
- <select id="branchChooser">
- <option>Choose a different version...
- </option><option value="">Stable
- </option><option value="beta">Beta
- </option><option value="dev">Dev
- </option><option value="trunk">Trunk
- </option></select>
- </div>
- <div id="unofficialWarning" class="displayModeWarning">
- <span>WARNING: This is unofficial documentation. It may not work with the
- current release of Chrome.</span>
- <button id="goToOfficialDocs">Go to the official docs</button>
- </div>
- <div id="gc-container" class="labs">
- <!-- SUBTEMPLATES: DO NOT MOVE FROM THIS LOCATION -->
- <!-- In particular, sub-templates that recurse, must be used by allowing
- jstemplate to make a copy of the template in this section which
- are not operated on by way of the jsskip="true" -->
- <!-- /SUBTEMPLATES -->
- <a id="top"></a>
- <div id="skipto">
- <a href="#gc-pagecontent">Skip to page content</a>
- <a href="#gc-toc">Skip to main navigation</a>
- </div>
- <!-- API HEADER -->
- <table id="header" width="100%" cellspacing="0" border="0">
- <tbody><tr>
- <td valign="middle"><a href="http://code.google.com/"><img src="images/code_labs_logo.gif" height="43" width="161" alt="Google Code Labs" style="border:0; margin:0;"></a></td>
- <td valign="middle" width="100%" style="padding-left:0.6em;">
- <form action="http://www.google.com/cse" id="cse" style="margin-top:0.5em">
- <div id="gsc-search-box">
- <input type="hidden" name="cx" value="002967670403910741006:61_cvzfqtno">
- <input type="hidden" name="ie" value="UTF-8">
- <input type="text" name="q" value="" size="55">
- <input class="gsc-search-button" type="submit" name="sa" value="Search">
- <br>
- <span class="greytext">e.g. "page action" or "tabs"</span>
- </div>
- </form>
- <script type="text/javascript" src="https://www.google.com/jsapi"></script>
- <script type="text/javascript">google.load("elements", "1", {packages: "transliteration"});</script>
- <script type="text/javascript" src="https://www.google.com/coop/cse/t13n?form=cse&amp;t13n_langs=en"></script>
- <script type="text/javascript" src="https://www.google.com/coop/cse/brand?form=cse&amp;lang=en"></script>
- </td>
- </tr>
- </tbody></table>
- <div id="codesiteContent" class="">
- <a id="gc-topnav-anchor"></a>
- <div id="gc-topnav">
- <h1>Google Chrome Extensions (<a href="http://code.google.com/labs/">Labs</a>)</h1>
- <ul id="home" class="gc-topnav-tabs">
- <li id="home_link">
- <a href="index.html" title="Google Chrome Extensions home page">Home</a>
- </li>
- <li id="docs_link">
- <a href="docs.html" title="Official Google Chrome Extensions documentation">Docs</a>
- </li>
- <li id="faq_link">
- <a href="faq.html" title="Answers to frequently asked questions about Google Chrome Extensions">FAQ</a>
- </li>
- <li id="samples_link">
- <a href="samples.html" title="Sample extensions (with source code)">Samples</a>
- </li>
- <li id="group_link">
- <a href="http://groups.google.com/a/chromium.org/group/chromium-extensions" title="Google Chrome Extensions developer forum">Group</a>
- </li>
- <li id="so_link">
- <a href="http://stackoverflow.com/questions/tagged/google-chrome-extension" title="[google-chrome-extension] tag on Stack Overflow">Questions?</a>
- </li>
- </ul>
- </div> <!-- end gc-topnav -->
- <div class="g-section g-tpl-170">
- <!-- SIDENAV -->
- <div class="g-unit g-first" id="gc-toc">
- <ul>
- <li><a href="getstarted.html">Getting Started</a></li>
- <li><a href="overview.html">Overview</a></li>
- <li><a href="whats_new.html">What's New?</a></li>
- <li><h2><a href="devguide.html">Developer's Guide</a></h2>
- <ul>
- <li>Browser UI
- <ul>
- <li><a href="browserAction.html">Browser Actions</a></li>
- <li><a href="contextMenus.html">Context Menus</a></li>
- <li><a href="notifications.html">Desktop Notifications</a></li>
- <li><a href="omnibox.html">Omnibox</a></li>
- <li><a href="options.html">Options Pages</a></li>
- <li><a href="override.html">Override Pages</a></li>
- <li><a href="pageAction.html">Page Actions</a></li>
- </ul>
- </li>
- <li>Browser Interaction
- <ul>
- <li><a href="bookmarks.html">Bookmarks</a></li>
- <li><a href="cookies.html">Cookies</a></li>
- <li><a href="devtools.html">Developer Tools</a></li>
- <li><a href="events.html">Events</a></li>
- <li><a href="history.html">History</a></li>
- <li><a href="management.html">Management</a></li>
- <li><a href="tabs.html">Tabs</a></li>
- <li><a href="windows.html">Windows</a></li>
- </ul>
- </li>
- <li>Implementation
- <ul>
- <li><a href="a11y.html">Accessibility</a></li>
- <li><a href="background_pages.html">Background Pages</a></li>
- <li><a href="content_scripts.html">Content Scripts</a></li>
- <li><a href="xhr.html">Cross-Origin XHR</a></li>
- <li><a href="i18n.html">Internationalization</a></li>
- <li><a href="messaging.html">Message Passing</a></li>
- <li><a href="permissions.html">Optional Permissions</a></li>
- <li><a href="npapi.html">NPAPI Plugins</a></li>
- </ul>
- </li>
- <li>Finishing
- <ul>
- <li><a href="hosting.html">Hosting</a></li>
- <li><a href="external_extensions.html">Other Deployment Options</a></li>
- </ul>
- </li>
- </ul>
- </li>
- <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
- <li><h2><a href="tutorials.html">Tutorials</a></h2>
- <ul>
- <li><a href="tut_debugging.html">Debugging</a></li>
- <li><a href="tut_analytics.html">Google Analytics</a></li>
- <li><a href="tut_oauth.html">OAuth</a></li>
- </ul>
- </li>
- <li><h2>Reference</h2>
- <ul>
- <li>Formats
- <ul>
- <li><a href="manifest.html">Manifest Files</a></li>
- <li><a href="match_patterns.html">Match Patterns</a></li>
- </ul>
- </li>
- <li><a href="permission_warnings.html">Permission Warnings</a></li>
- <li><a href="api_index.html">chrome.* APIs</a></li>
- <li><a href="api_other.html">Other APIs</a></li>
- </ul>
- </li>
- <li><h2><a href="samples.html">Samples</a></h2></li>
- <div class="line"> </div>
- <li><h2>More</h2>
- <ul>
- <li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
- <li><a href="themes.html">Themes</a></li>
- </ul>
- </li>
- </ul>
- </div>
- <script>
- initToggles();
- </script>
- <div class="g-unit" id="gc-pagecontent">
- <div id="pageTitle">
- <h1 class="page_title">chrome.declarative</h1>
- </div>
- <!-- TABLE OF CONTENTS -->
- <div id="toc">
- <h2>Contents</h2>
- <ol>
- <li>
- <a href="#notes">Notes</a>
- <ol>
- </ol>
- </li><li>
- <a href="#manifest">Manifest</a>
- <ol>
- </ol>
- </li><li>
- <a href="#rules">Rules</a>
- <ol>
- </ol>
- </li><li>
- <a href="#eventobjects">Event objects</a>
- <ol>
- <li>
- <a href="#addingrules">Adding rules</a>
- </li><li>
- <a href="#removingrules">Removing rules</a>
- </li><li>
- <a href="#retrievingrules">Retrieving rules</a>
- </li>
- </ol>
- </li>
- <li>
- <a href="#apiReference">API reference: chrome.declarative</a>
- <ol>
- <li>
- <a href="#global-methods">Methods</a>
- <ol>
- <li>
- <a href="#method-addRules">addRules</a>
- </li><li>
- <a href="#method-getRules">getRules</a>
- </li><li>
- <a href="#method-removeRules">removeRules</a>
- </li>
- </ol>
- </li>
- <li>
- <a href="#types">Types</a>
- <ol>
- <li>
- <a href="#type-Rule">Rule</a>
- <ol>
- </ol>
- </li><li>
- <a href="#type-UrlFilter">UrlFilter</a>
- <ol>
- </ol>
- </li>
- </ol>
- </li>
- </ol>
- </li>
- </ol>
- </div>
- <!-- /TABLE OF CONTENTS -->
- <!-- Standard content lead-in for experimental API pages -->
- <p class="warning">
- <!-- Standard content lead-in for APIs that are not yet available on
- the stable channel. -->
- <em>Warning:</em> This API is still under development. It is only
- available for Chrome users on the
- <span>
- <strong>dev</strong>
- <a href="http://www.chromium.org/getting-involved/dev-channel">early
- release channel</a>.</span>
- <a href="TODO">Learn more</a>.
- </p>
- <!-- STATIC CONTENT PLACEHOLDER -->
- <div id="static"><!-- BEGIN AUTHORED CONTENT -->
-<h2 id="notes">Notes</h2>
-<p>
-The Declarative API is a framework to define rules consisting of declarative
-conditions and actions. Conditions are evaluated in the browser rather than the
-JavaScript engine which reduces roundtrip latencies and allows for very high
-efficiency.
-</p>
-<p></p>The Declarative API is an abstract foundation for the <a href="declarativeWebRequest.html">Declarative Web Request API</a> and
-possibly further extension APIs in the future. This page describes the
-underlying concepts of all Declarative APIs.
-<p></p>
-<h2 id="manifest">Manifest</h2>
-<p>
-You must declare the "declarative" permission in your extension's manifest
-to use APIs that are based on this API.
-</p>
-<pre>{
- "name": "My extension",
- ...
-<b> "permissions": [
- "declarative",
- ]</b>,
- ...
-}</pre>
-<h2 id="rules">Rules</h2>
-<p>The simplest possible rule consists of one or more conditions and one or more
-actions:</p>
-<pre>var rule = {
- conditions: [ /* my conditions */ ],
- actions: [ /* my actions */ ]
-};
-</pre>
-<p>If any of the conditions is fulfilled, all actions are executed.</p>
-<p>In addition to conditions and actions you may give each rule an identifier,
-which simplifies unregistering previously registered rules, and a priority to
-define precedences among rules. Priorities are only considered if rules conflict
-each other or need to be executed in a specific order.</p>
-<pre>var rule = {
- id: "my rule", // optional, will be generated if not set.
- priority: 100, // optional, defaults to 100.
- conditions: [ /* my conditions */ ],
- actions: [ /* my actions */ ]
-};
-</pre>
-<h2 id="eventobjects">Event objects</h2>
-<p>
-<a href="events.html">Event objects</a> may support rules. These event objects
-don't call a callback function when events happer but test whether any
-registered rule has at least one fulfilled condition and execute the actions
-associated with this rule. Event objects supporting the declarative API have
-three relevant methods: <a href="#method-addRules"><code>addRules()</code></a>,
-<a href="#method-removeRules"><code>removeRules()</code></a>, and
-<a href="#method-getRules"><code>getRules()</code></a>.
-</p>
-<h3 id="addingrules">Adding rules</h3>
-<p>
-To add rules call the <code>addRules()</code> function of the event object. It
-takes an array of rule instances as its first parameter and a callback function
-that is called on completion.
-</p>
-<pre>var rule_list = [rule1, rule2, ...];
-function addRules(rule_list, function callback(details) {...});
-</pre>
-<p>
-If the rules were inserted successfully, the <code>details</code> parameter
-contains an array of inserted rules appearing in the same order as in the passed
-<code>rule_list</code> where the optional parameters <code>id</code> and
-<code>priority</code> were filled with the generated values. If any rule is
-invalid, e.g., because it contained an invalid condition or action, none of the
-rules are added and the <a href="extension.html#property-lastError">lastError</a> variable is set when
-the callback function is called. Each rule in <code>rule_list</code> must
-contain a unique identifier that is not currently used by another rule or an
-empty identifier.
-</p>
-<h3 id="removingrules">Removing rules</h3>
-<p>
-To remove rules call the <code>removeRules()</code> function. It accepts an
-optional array of rule identifiers as its first parameter and a callback
-function as its second parameter.
-</p>
-<pre>var rule_ids = ["id1", "id2", ...];
-function removeRules(rule_ids, function callback() {...});
-</pre>
-<p>
-If <code>rule_ids</code> is an array of identifiers, all rules having
-identifiers listed in the array are removed. If <code>rule_ids</code> lists an
-identifier, that is unknown, this identifier is silently ignored. If
-<code>rule_ids</code> is <code>undefined</code>, all registered rules of this
-extension are removed. The <code>callback()</code> function is called when the
-rules were removed.
-</p>
-<h3 id="retrievingrules">Retrieving rules</h3>
-<p>
-To retrieve a list of currently registered rules, call the
-<code>getRules()</code> function. It accepts an optional array of rule
-identifiers with the same semantics as <code>removeRules</code> and a callback
-function.
-</p><p>
-</p><pre>var rule_ids = ["id1", "id2", ...];
-function getRules(rule_ids, function callback(details) {...});
-</pre>
-<p>
-The <code>details</code> parameter passed to the <code>calback()</code> function
-refers to an array of rules including filled optional parameters.
-</p>
-<!-- END AUTHORED CONTENT -->
-</div>
- <!-- API PAGE -->
- <div class="apiPage">
- <a name="apiReference"></a>
- <h2>API reference: chrome.declarative</h2>
- <!-- PROPERTIES -->
- <!-- /apiGroup -->
- <!-- METHODS -->
- <div id="methodsTemplate" class="apiGroup">
- <a name="global-methods"></a>
- <h3>Methods</h3>
- <!-- iterates over all functions -->
- <div class="apiItem">
- <a name="method-addRules"></a> <!-- method-anchor -->
- <h4>addRules</h4>
- <div class="summary">
- <!-- Note: intentionally longer 80 columns -->
- <span>chrome.declarative.addRules</span>(<span class="null"><span>array of Rule</span>
- <var><span>rules</span></var></span><span class="optional"><span>, </span><span>function</span>
- <var><span>callback</span></var></span>)</div>
- <div class="description">
- <p>Registers rules to handle events. Note that you cannot call this function as <code>chrome.declarative.addRules(...)</code>. Instead a function of this signature is provided for event objects supporting the declarative API such as <code>chrome.declarativeWebRequest.onRequest</code>.</p>
- <!-- PARAMETERS -->
- <h4>Parameters</h4>
- <dl>
- <div>
- <div>
- <dt>
- <var>rules</var>
- <em>
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span id="typeTemplate">
- <span>
- <span>
- array of <span><span>
- <span>
- <a href="declarative.html#type-Rule">Rule</a>
- </span>
- </span></span>
- </span>
- </span>
- </span>
- )
- </div>
- </em>
- </dt>
- <dd>Rules to be registered. These do not replace previously registered rules.</dd>
- <!-- OBJECT PROPERTIES -->
- <!-- OBJECT METHODS -->
- <!-- OBJECT EVENT FIELDS -->
- <!-- FUNCTION PARAMETERS -->
- </div>
- </div><div>
- <div>
- <dt>
- <var>callback</var>
- <em>
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span id="typeTemplate">
- <span>
- <span>function</span>
- </span>
- </span>
- )
- </div>
- </em>
- </dt>
- <dd>Called with registered rules.</dd>
- <!-- OBJECT PROPERTIES -->
- <!-- OBJECT METHODS -->
- <!-- OBJECT EVENT FIELDS -->
- <!-- FUNCTION PARAMETERS -->
- </div>
- </div>
- </dl>
- <!-- RETURNS -->
- <dl>
- </dl>
- <!-- CALLBACK -->
- <div>
- <div>
- <h4>Callback function</h4>
- <p>
- If you specify the <em>callback</em> parameter, it should
- specify a function that looks like this:
- </p>
- <!-- Note: intentionally longer 80 columns -->
- <pre>function(<span>array of Rule rules</span>) <span class="subdued">{...}</span>;</pre>
- <dl>
- <div>
- <div>
- <dt>
- <var>rules</var>
- <em>
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span id="typeTemplate">
- <span>
- <span>
- array of <span><span>
- <span>
- <a href="declarative.html#type-Rule">Rule</a>
- </span>
- </span></span>
- </span>
- </span>
- </span>
- )
- </div>
- </em>
- </dt>
- <dd>Rules that were registered, the optional parameters are filled with values.</dd>
- <!-- OBJECT PROPERTIES -->
- <!-- OBJECT METHODS -->
- <!-- OBJECT EVENT FIELDS -->
- <!-- FUNCTION PARAMETERS -->
- </div>
- </div>
- </dl>
- </div>
- </div>
- <!-- MIN_VERSION -->
- </div> <!-- /description -->
- </div><div class="apiItem">
- <a name="method-getRules"></a> <!-- method-anchor -->
- <h4>getRules</h4>
- <div class="summary">
- <!-- Note: intentionally longer 80 columns -->
- <span>chrome.declarative.getRules</span>(<span class="optional"><span>array of string</span>
- <var><span>ruleIdentifiers</span></var></span><span class="null"><span>, </span><span>function</span>
- <var><span>callback</span></var></span>)</div>
- <div class="description">
- <p>Returns currently registered rules. Note that you cannot call this function as <code>chrome.declarative.getRules(...)</code>. Instead a function of this signature is provided for event objects supporting the declarative API such as <code>chrome.declarativeWebRequest.onRequest</code>.</p>
- <!-- PARAMETERS -->
- <h4>Parameters</h4>
- <dl>
- <div>
- <div>
- <dt>
- <var>ruleIdentifiers</var>
- <em>
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span id="typeTemplate">
- <span>
- <span>
- array of <span><span>
- <span>
- <span>string</span>
- </span>
- </span></span>
- </span>
- </span>
- </span>
- )
- </div>
- </em>
- </dt>
- <dd>If an array is passed, only rules with identifiers contained in this array are returned.</dd>
- <!-- OBJECT PROPERTIES -->
- <!-- OBJECT METHODS -->
- <!-- OBJECT EVENT FIELDS -->
- <!-- FUNCTION PARAMETERS -->
- </div>
- </div><div>
- <div>
- <dt>
- <var>callback</var>
- <em>
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span id="typeTemplate">
- <span>
- <span>function</span>
- </span>
- </span>
- )
- </div>
- </em>
- </dt>
- <dd>Called with registered rules.</dd>
- <!-- OBJECT PROPERTIES -->
- <!-- OBJECT METHODS -->
- <!-- OBJECT EVENT FIELDS -->
- <!-- FUNCTION PARAMETERS -->
- </div>
- </div>
- </dl>
- <!-- RETURNS -->
- <dl>
- </dl>
- <!-- CALLBACK -->
- <div>
- <div>
- <h4>Callback function</h4>
- <p>
- The callback <em>parameter</em> should specify a function
- that looks like this:
- </p>
- <!-- Note: intentionally longer 80 columns -->
- <pre>function(<span>array of Rule rules</span>) <span class="subdued">{...}</span>;</pre>
- <dl>
- <div>
- <div>
- <dt>
- <var>rules</var>
- <em>
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span id="typeTemplate">
- <span>
- <span>
- array of <span><span>
- <span>
- <a href="declarative.html#type-Rule">Rule</a>
- </span>
- </span></span>
- </span>
- </span>
- </span>
- )
- </div>
- </em>
- </dt>
- <dd>Rules that were registered, the optional parameters are filled with values.</dd>
- <!-- OBJECT PROPERTIES -->
- <!-- OBJECT METHODS -->
- <!-- OBJECT EVENT FIELDS -->
- <!-- FUNCTION PARAMETERS -->
- </div>
- </div>
- </dl>
- </div>
- </div>
- <!-- MIN_VERSION -->
- </div> <!-- /description -->
- </div><div class="apiItem">
- <a name="method-removeRules"></a> <!-- method-anchor -->
- <h4>removeRules</h4>
- <div class="summary">
- <!-- Note: intentionally longer 80 columns -->
- <span>chrome.declarative.removeRules</span>(<span class="optional"><span>array of string</span>
- <var><span>ruleIdentifiers</span></var></span><span class="optional"><span>, </span><span>function</span>
- <var><span>callback</span></var></span>)</div>
- <div class="description">
- <p>Unregisters currently registered rules. Note that you cannot call this function as <code>chrome.declarative.removeRules(...)</code>. Instead a function of this signature is provided for event objects supporting the declarative API such as <code>chrome.declarativeWebRequest.onRequest</code>.</p>
- <!-- PARAMETERS -->
- <h4>Parameters</h4>
- <dl>
- <div>
- <div>
- <dt>
- <var>ruleIdentifiers</var>
- <em>
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span id="typeTemplate">
- <span>
- <span>
- array of <span><span>
- <span>
- <span>string</span>
- </span>
- </span></span>
- </span>
- </span>
- </span>
- )
- </div>
- </em>
- </dt>
- <dd>If an array is passed, only rules with identifiers contained in this array are unregistered.</dd>
- <!-- OBJECT PROPERTIES -->
- <!-- OBJECT METHODS -->
- <!-- OBJECT EVENT FIELDS -->
- <!-- FUNCTION PARAMETERS -->
- </div>
- </div><div>
- <div>
- <dt>
- <var>callback</var>
- <em>
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span id="typeTemplate">
- <span>
- <span>function</span>
- </span>
- </span>
- )
- </div>
- </em>
- </dt>
- <dd>Called when rules were unregistered.</dd>
- <!-- OBJECT PROPERTIES -->
- <!-- OBJECT METHODS -->
- <!-- OBJECT EVENT FIELDS -->
- <!-- FUNCTION PARAMETERS -->
- </div>
- </div>
- </dl>
- <!-- RETURNS -->
- <dl>
- </dl>
- <!-- CALLBACK -->
- <div>
- <div>
- <h4>Callback function</h4>
- <p>
- If you specify the <em>callback</em> parameter, it should
- specify a function that looks like this:
- </p>
- <!-- Note: intentionally longer 80 columns -->
- <pre>function(<span></span>) <span class="subdued">{...}</span>;</pre>
- <dl>
- </dl>
- </div>
- </div>
- <!-- MIN_VERSION -->
- </div> <!-- /description -->
- </div> <!-- /apiItem -->
- </div> <!-- /apiGroup -->
- <!-- EVENTS -->
- <!-- /apiGroup -->
- <!-- TYPES -->
- <div class="apiGroup">
- <a name="types"></a>
- <h3 id="types">Types</h3>
- <!-- iterates over all types -->
- <div class="apiItem">
- <a name="type-Rule"></a>
- <h4>Rule</h4>
- <div>
- <dt>
- <em>
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span id="typeTemplate">
- <span>
- <span>object</span>
- </span>
- </span>
- )
- </div>
- </em>
- </dt>
- <dd>Description of a declarative rule for handling events.</dd>
- <!-- OBJECT PROPERTIES -->
- <dd>
- <dl>
- <div>
- <div>
- <dt>
- <var>id</var>
- <em>
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span id="typeTemplate">
- <span>
- <span>string</span>
- </span>
- </span>
- )
- </div>
- </em>
- </dt>
- <dd>Optional identifier that allows referencing this rule.</dd>
- <!-- OBJECT PROPERTIES -->
- <!-- OBJECT METHODS -->
- <!-- OBJECT EVENT FIELDS -->
- <!-- FUNCTION PARAMETERS -->
- </div>
- </div><div>
- <div>
- <dt>
- <var>conditions</var>
- <em>
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span id="typeTemplate">
- <span>
- <span>
- array of <span><span>
- <span>
- <span>any</span>
- </span>
- </span></span>
- </span>
- </span>
- </span>
- )
- </div>
- </em>
- </dt>
- <dd>List of conditions that can trigger the actions.</dd>
- <!-- OBJECT PROPERTIES -->
- <!-- OBJECT METHODS -->
- <!-- OBJECT EVENT FIELDS -->
- <!-- FUNCTION PARAMETERS -->
- </div>
- </div><div>
- <div>
- <dt>
- <var>actions</var>
- <em>
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span id="typeTemplate">
- <span>
- <span>
- array of <span><span>
- <span>
- <span>any</span>
- </span>
- </span></span>
- </span>
- </span>
- </span>
- )
- </div>
- </em>
- </dt>
- <dd>List of actions that are triggered if one of the condtions is fulfilled.</dd>
- <!-- OBJECT PROPERTIES -->
- <!-- OBJECT METHODS -->
- <!-- OBJECT EVENT FIELDS -->
- <!-- FUNCTION PARAMETERS -->
- </div>
- </div><div>
- <div>
- <dt>
- <var>priority</var>
- <em>
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span id="typeTemplate">
- <span>
- <span>integer</span>
- </span>
- </span>
- )
- </div>
- </em>
- </dt>
- <dd>Optional priority of this rule. Defaults to 100.</dd>
- <!-- OBJECT PROPERTIES -->
- <!-- OBJECT METHODS -->
- <!-- OBJECT EVENT FIELDS -->
- <!-- FUNCTION PARAMETERS -->
- </div>
- </div>
- </dl>
- </dd>
- <!-- OBJECT METHODS -->
- <!-- OBJECT EVENT FIELDS -->
- <!-- FUNCTION PARAMETERS -->
- </div>
- </div><div class="apiItem">
- <a name="type-UrlFilter"></a>
- <h4>UrlFilter</h4>
- <div>
- <dt>
- <em>
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span id="typeTemplate">
- <span>
- <span>object</span>
- </span>
- </span>
- )
- </div>
- </em>
- </dt>
- <dd>Filters URLs for various criteria</dd>
- <!-- OBJECT PROPERTIES -->
- <dd>
- <dl>
- <div>
- <div>
- <dt>
- <var>hostContains</var>
- <em>
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span id="typeTemplate">
- <span>
- <span>string</span>
- </span>
- </span>
- )
- </div>
- </em>
- </dt>
- <dd>Matches if the host name of the URL contains a specified string.</dd>
- <!-- OBJECT PROPERTIES -->
- <!-- OBJECT METHODS -->
- <!-- OBJECT EVENT FIELDS -->
- <!-- FUNCTION PARAMETERS -->
- </div>
- </div><div>
- <div>
- <dt>
- <var>hostEquals</var>
- <em>
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span id="typeTemplate">
- <span>
- <span>string</span>
- </span>
- </span>
- )
- </div>
- </em>
- </dt>
- <dd>Matches if the host name of the URL is equal to a specified string.</dd>
- <!-- OBJECT PROPERTIES -->
- <!-- OBJECT METHODS -->
- <!-- OBJECT EVENT FIELDS -->
- <!-- FUNCTION PARAMETERS -->
- </div>
- </div><div>
- <div>
- <dt>
- <var>hostPrefix</var>
- <em>
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span id="typeTemplate">
- <span>
- <span>string</span>
- </span>
- </span>
- )
- </div>
- </em>
- </dt>
- <dd>Matches if the host name of the URL starts with a specified string.</dd>
- <!-- OBJECT PROPERTIES -->
- <!-- OBJECT METHODS -->
- <!-- OBJECT EVENT FIELDS -->
- <!-- FUNCTION PARAMETERS -->
- </div>
- </div><div>
- <div>
- <dt>
- <var>hostSuffix</var>
- <em>
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span id="typeTemplate">
- <span>
- <span>string</span>
- </span>
- </span>
- )
- </div>
- </em>
- </dt>
- <dd>Matches if the host name of the URL ends with a specified string.</dd>
- <!-- OBJECT PROPERTIES -->
- <!-- OBJECT METHODS -->
- <!-- OBJECT EVENT FIELDS -->
- <!-- FUNCTION PARAMETERS -->
- </div>
- </div><div>
- <div>
- <dt>
- <var>pathContains</var>
- <em>
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span id="typeTemplate">
- <span>
- <span>string</span>
- </span>
- </span>
- )
- </div>
- </em>
- </dt>
- <dd>Matches if the path segment of the URL contains a specified string.</dd>
- <!-- OBJECT PROPERTIES -->
- <!-- OBJECT METHODS -->
- <!-- OBJECT EVENT FIELDS -->
- <!-- FUNCTION PARAMETERS -->
- </div>
- </div><div>
- <div>
- <dt>
- <var>pathEquals</var>
- <em>
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span id="typeTemplate">
- <span>
- <span>string</span>
- </span>
- </span>
- )
- </div>
- </em>
- </dt>
- <dd>Matches if the path segment of the URL is equal to a specified string.</dd>
- <!-- OBJECT PROPERTIES -->
- <!-- OBJECT METHODS -->
- <!-- OBJECT EVENT FIELDS -->
- <!-- FUNCTION PARAMETERS -->
- </div>
- </div><div>
- <div>
- <dt>
- <var>pathPrefix</var>
- <em>
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span id="typeTemplate">
- <span>
- <span>string</span>
- </span>
- </span>
- )
- </div>
- </em>
- </dt>
- <dd>Matches if the path segment of the URL starts with a specified string.</dd>
- <!-- OBJECT PROPERTIES -->
- <!-- OBJECT METHODS -->
- <!-- OBJECT EVENT FIELDS -->
- <!-- FUNCTION PARAMETERS -->
- </div>
- </div><div>
- <div>
- <dt>
- <var>pathSuffix</var>
- <em>
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span id="typeTemplate">
- <span>
- <span>string</span>
- </span>
- </span>
- )
- </div>
- </em>
- </dt>
- <dd>Matches if the path segment of the URL ends with a specified string.</dd>
- <!-- OBJECT PROPERTIES -->
- <!-- OBJECT METHODS -->
- <!-- OBJECT EVENT FIELDS -->
- <!-- FUNCTION PARAMETERS -->
- </div>
- </div><div>
- <div>
- <dt>
- <var>queryEquals</var>
- <em>
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span id="typeTemplate">
- <span>
- <span>string</span>
- </span>
- </span>
- )
- </div>
- </em>
- </dt>
- <dd>Matches if the query segment of the URL is equal to a specified string.</dd>
- <!-- OBJECT PROPERTIES -->
- <!-- OBJECT METHODS -->
- <!-- OBJECT EVENT FIELDS -->
- <!-- FUNCTION PARAMETERS -->
- </div>
- </div><div>
- <div>
- <dt>
- <var>queryPrefix</var>
- <em>
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span id="typeTemplate">
- <span>
- <span>string</span>
- </span>
- </span>
- )
- </div>
- </em>
- </dt>
- <dd>Matches if the query segment of the URL starts with a specified string.</dd>
- <!-- OBJECT PROPERTIES -->
- <!-- OBJECT METHODS -->
- <!-- OBJECT EVENT FIELDS -->
- <!-- FUNCTION PARAMETERS -->
- </div>
- </div><div>
- <div>
- <dt>
- <var>querySuffix</var>
- <em>
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span id="typeTemplate">
- <span>
- <span>string</span>
- </span>
- </span>
- )
- </div>
- </em>
- </dt>
- <dd>Matches if the query segment of the URL ends with a specified string.</dd>
- <!-- OBJECT PROPERTIES -->
- <!-- OBJECT METHODS -->
- <!-- OBJECT EVENT FIELDS -->
- <!-- FUNCTION PARAMETERS -->
- </div>
- </div><div>
- <div>
- <dt>
- <var>urlSuffix</var>
- <em>
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span id="typeTemplate">
- <span>
- <span>string</span>
- </span>
- </span>
- )
- </div>
- </em>
- </dt>
- <dd>Matches if the URL ends with a specified string.</dd>
- <!-- OBJECT PROPERTIES -->
- <!-- OBJECT METHODS -->
- <!-- OBJECT EVENT FIELDS -->
- <!-- FUNCTION PARAMETERS -->
- </div>
- </div><div>
- <div>
- <dt>
- <var>urlEquals</var>
- <em>
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span id="typeTemplate">
- <span>
- <span>string</span>
- </span>
- </span>
- )
- </div>
- </em>
- </dt>
- <dd>Matches if the URL is equal to a specified string.</dd>
- <!-- OBJECT PROPERTIES -->
- <!-- OBJECT METHODS -->
- <!-- OBJECT EVENT FIELDS -->
- <!-- FUNCTION PARAMETERS -->
- </div>
- </div><div>
- <div>
- <dt>
- <var>urlPrefix</var>
- <em>
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span id="typeTemplate">
- <span>
- <span>string</span>
- </span>
- </span>
- )
- </div>
- </em>
- </dt>
- <dd>Matches if the URL starts with a specified string.</dd>
- <!-- OBJECT PROPERTIES -->
- <!-- OBJECT METHODS -->
- <!-- OBJECT EVENT FIELDS -->
- <!-- FUNCTION PARAMETERS -->
- </div>
- </div><div>
- <div>
- <dt>
- <var>schemes</var>
- <em>
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span id="typeTemplate">
- <span>
- <span>
- array of <span><span>
- <span>
- <span>string</span>
- </span>
- </span></span>
- </span>
- </span>
- </span>
- )
- </div>
- </em>
- </dt>
- <dd>Matches if the scheme of the URL is equal to any of the schemes specified in the array.</dd>
- <!-- OBJECT PROPERTIES -->
- <!-- OBJECT METHODS -->
- <!-- OBJECT EVENT FIELDS -->
- <!-- FUNCTION PARAMETERS -->
- </div>
- </div><div>
- <div>
- <dt>
- <var>ports</var>
- <em>
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span id="typeTemplate">
- <span>
- <span>
- array of <span><span>
- <span>
- <span>integer or array of integer</span>
- </span>
- </span></span>
- </span>
- </span>
- </span>
- )
- </div>
- </em>
- </dt>
- <dd>Matches if the port of the URL is contained in any of the specified port lists. For example <code>[80, 443, [1000, 1200]]</code> matches all requests on port 80, 443 and in the range 1000-1200.</dd>
- <!-- OBJECT PROPERTIES -->
- <!-- OBJECT METHODS -->
- <!-- OBJECT EVENT FIELDS -->
- <!-- FUNCTION PARAMETERS -->
- </div>
- </div>
- </dl>
- </dd>
- <!-- OBJECT METHODS -->
- <!-- OBJECT EVENT FIELDS -->
- <!-- FUNCTION PARAMETERS -->
- </div>
- </div> <!-- /apiItem -->
- </div> <!-- /apiGroup -->
- </div> <!-- /apiPage -->
- </div> <!-- /gc-pagecontent -->
- </div> <!-- /g-section -->
- </div> <!-- /codesiteContent -->
- <div id="gc-footer" --="">
- <div class="text">
- <p>
- Except as otherwise <a href="http://code.google.com/policies.html#restrictions">noted</a>,
- the content of this page is licensed under the <a rel="license" href="http://creativecommons.org/licenses/by/3.0/">Creative Commons
- Attribution 3.0 License</a>, and code samples are licensed under the
- <a rel="license" href="http://code.google.com/google_bsd_license.html">BSD License</a>.
- </p>
- <p>
- ©2011 Google
- </p>
-<!-- begin analytics -->
-<script src="https://www.google-analytics.com/urchin.js" type="text/javascript"></script>
-<script src="https://www.google-analytics.com/ga.js" type="text/javascript"></script>
-<script type="text/javascript">
- // chrome doc tracking
- try {
- var engdocs = _gat._getTracker("YT-10763712-2");
- engdocs._trackPageview();
- } catch(err) {}
- // code.google.com site-wide tracking
- try {
- _uacct="UA-18071-1";
- _uanchor=1;
- _uff=0;
- urchinTracker();
- }
- catch(e) {/* urchinTracker not available. */}
-</script>
-<!-- end analytics -->
- </div>
- </div> <!-- /gc-footer -->
- </div> <!-- /gc-container -->
-</body></html>
« no previous file with comments | « chrome/common/extensions/docs/api_index.html ('k') | chrome/common/extensions/docs/declarativeWebRequest.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698