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

Side by Side Diff: chrome/common/extensions/docs/declarativeWebRequest.html

Issue 10642015: Basic setup for generating app docs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html><!-- This page is a placeholder for generated extensions api doc. Note:
2 1) The <head> information in this page is significant, should be uniform
3 across api docs and should be edited only with knowledge of the
4 templating mechanism.
5 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a
6 browser, it will be re-generated from the template, json schema and
7 authored overview content.
8 4) The <body>.innerHTML is also generated by an offline step so that this
9 page may easily be indexed by search engines.
10 --><html xmlns="http://www.w3.org/1999/xhtml"><head>
11 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
12 <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css">
13 <link href="css/print.css" rel="stylesheet" type="text/css" media="print">
14 <script type="text/javascript" src="../../../third_party/jstemplate/jstempla te_compiled.js">
15 </script>
16 <script type="text/javascript" src="../../../../third_party/json_minify/mini fy-sans-regexp.js">
17 </script>
18 <script type="text/javascript" src="js/api_page_generator.js"></script>
19 <script type="text/javascript" src="js/bootstrap.js"></script>
20 <script type="text/javascript" src="js/sidebar.js"></script>
21 <meta name="description" content="Documentation for the chrome.declarativeWebR equest module, which is part of the Google Chrome extension APIs."><title>chrom e.declarativeWebRequest - Google Chrome Extensions - Google Code</title></head>
22 <body> <div id="devModeWarning" class="displayModeWarning">
23 You are viewing extension docs in chrome via the 'file:' scheme: are you exp ecting to see local changes when you refresh? You'll need run chrome with --allo w-file-access-from-files.
24 </div>
25 <div id="branchWarning" class="displayModeWarning">
26 <span>WARNING: This is the <span id="branchName">BETA</span> documentation.
27 It may not work with the stable release of Chrome.</span>
28 <select id="branchChooser">
29 <option>Choose a different version...
30 </option><option value="">Stable
31 </option><option value="beta">Beta
32 </option><option value="dev">Dev
33 </option><option value="trunk">Trunk
34 </option></select>
35 </div>
36 <div id="unofficialWarning" class="displayModeWarning">
37 <span>WARNING: This is unofficial documentation. It may not work with the
38 current release of Chrome.</span>
39 <button id="goToOfficialDocs">Go to the official docs</button>
40 </div>
41 <div id="gc-container" class="labs">
42 <!-- SUBTEMPLATES: DO NOT MOVE FROM THIS LOCATION -->
43 <!-- In particular, sub-templates that recurse, must be used by allowing
44 jstemplate to make a copy of the template in this section which
45 are not operated on by way of the jsskip="true" -->
46 <!-- /SUBTEMPLATES -->
47 <a id="top"></a>
48 <div id="skipto">
49 <a href="#gc-pagecontent">Skip to page content</a>
50 <a href="#gc-toc">Skip to main navigation</a>
51 </div>
52 <!-- API HEADER -->
53 <table id="header" width="100%" cellspacing="0" border="0">
54 <tbody><tr>
55 <td valign="middle"><a href="http://code.google.com/"><img src="images/c ode_labs_logo.gif" height="43" width="161" alt="Google Code Labs" style="border: 0; margin:0;"></a></td>
56 <td valign="middle" width="100%" style="padding-left:0.6em;">
57 <form action="http://www.google.com/cse" id="cse" style="margin-top:0. 5em">
58 <div id="gsc-search-box">
59 <input type="hidden" name="cx" value="002967670403910741006:61_cvz fqtno">
60 <input type="hidden" name="ie" value="UTF-8">
61 <input type="text" name="q" value="" size="55">
62 <input class="gsc-search-button" type="submit" name="sa" value="Se arch">
63 <br>
64 <span class="greytext">e.g. "page action" or "tabs"</span>
65 </div>
66 </form>
67 <script type="text/javascript" src="https://www.google.com/jsapi"></sc ript>
68 <script type="text/javascript">google.load("elements", "1", {packages: "transliteration"});</script>
69 <script type="text/javascript" src="https://www.google.com/coop/cse/t1 3n?form=cse&amp;t13n_langs=en"></script>
70 <script type="text/javascript" src="https://www.google.com/coop/cse/br and?form=cse&amp;lang=en"></script>
71 </td>
72 </tr>
73 </tbody></table>
74 <div id="codesiteContent" class="">
75 <a id="gc-topnav-anchor"></a>
76 <div id="gc-topnav">
77 <h1>Google Chrome Extensions (<a href="http://code.google.com/labs/">Lab s</a>)</h1>
78 <ul id="home" class="gc-topnav-tabs">
79 <li id="home_link">
80 <a href="index.html" title="Google Chrome Extensions home page">Home </a>
81 </li>
82 <li id="docs_link">
83 <a href="docs.html" title="Official Google Chrome Extensions documen tation">Docs</a>
84 </li>
85 <li id="faq_link">
86 <a href="faq.html" title="Answers to frequently asked questions abou t Google Chrome Extensions">FAQ</a>
87 </li>
88 <li id="samples_link">
89 <a href="samples.html" title="Sample extensions (with source code)"> Samples</a>
90 </li>
91 <li id="group_link">
92 <a href="http://groups.google.com/a/chromium.org/group/chromium-exte nsions" title="Google Chrome Extensions developer forum">Group</a>
93 </li>
94 <li id="so_link">
95 <a href="http://stackoverflow.com/questions/tagged/google-chrome-ext ension" title="[google-chrome-extension] tag on Stack Overflow">Questions?</a>
96 </li>
97 </ul>
98 </div> <!-- end gc-topnav -->
99 <div class="g-section g-tpl-170">
100 <!-- SIDENAV -->
101 <div class="g-unit g-first" id="gc-toc">
102 <ul>
103 <li><a href="getstarted.html">Getting Started</a></li>
104 <li><a href="overview.html">Overview</a></li>
105 <li><a href="whats_new.html">What's New?</a></li>
106 <li><h2><a href="devguide.html">Developer's Guide</a></h2>
107 <ul>
108 <li>Browser UI
109 <ul>
110 <li><a href="browserAction.html">Browser Actions</a></li>
111 <li><a href="contextMenus.html">Context Menus</a></li>
112 <li><a href="notifications.html">Desktop Notifications</a></li >
113 <li><a href="omnibox.html">Omnibox</a></li>
114 <li><a href="options.html">Options Pages</a></li>
115 <li><a href="override.html">Override Pages</a></li>
116 <li><a href="pageAction.html">Page Actions</a></li>
117 </ul>
118 </li>
119 <li>Browser Interaction
120 <ul>
121 <li><a href="bookmarks.html">Bookmarks</a></li>
122 <li><a href="cookies.html">Cookies</a></li>
123 <li><a href="devtools.html">Developer Tools</a></li>
124 <li><a href="events.html">Events</a></li>
125 <li><a href="history.html">History</a></li>
126 <li><a href="management.html">Management</a></li>
127 <li><a href="tabs.html">Tabs</a></li>
128 <li><a href="windows.html">Windows</a></li>
129 </ul>
130 </li>
131 <li>Implementation
132 <ul>
133 <li><a href="a11y.html">Accessibility</a></li>
134 <li><a href="background_pages.html">Background Pages</a></li>
135 <li><a href="content_scripts.html">Content Scripts</a></li>
136 <li><a href="xhr.html">Cross-Origin XHR</a></li>
137 <li><a href="i18n.html">Internationalization</a></li>
138 <li><a href="messaging.html">Message Passing</a></li>
139 <li><a href="permissions.html">Optional Permissions</a></li>
140 <li><a href="npapi.html">NPAPI Plugins</a></li>
141 </ul>
142 </li>
143 <li>Finishing
144 <ul>
145 <li><a href="hosting.html">Hosting</a></li>
146 <li><a href="external_extensions.html">Other Deployment Option s</a></li>
147 </ul>
148 </li>
149 </ul>
150 </li>
151 <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
152 <li><h2><a href="tutorials.html">Tutorials</a></h2>
153 <ul>
154 <li><a href="tut_debugging.html">Debugging</a></li>
155 <li><a href="tut_analytics.html">Google Analytics</a></li>
156 <li><a href="tut_oauth.html">OAuth</a></li>
157 </ul>
158 </li>
159 <li><h2>Reference</h2>
160 <ul>
161 <li>Formats
162 <ul>
163 <li><a href="manifest.html">Manifest Files</a></li>
164 <li><a href="match_patterns.html">Match Patterns</a></li>
165 </ul>
166 </li>
167 <li><a href="permission_warnings.html">Permission Warnings</a></li >
168 <li><a href="api_index.html">chrome.* APIs</a></li>
169 <li><a href="api_other.html">Other APIs</a></li>
170 </ul>
171 </li>
172 <li><h2><a href="samples.html">Samples</a></h2></li>
173 <div class="line"> </div>
174 <li><h2>More</h2>
175 <ul>
176 <li><a href="http://code.google.com/chrome/webstore/docs/index.htm l">Chrome Web Store</a></li>
177 <li><a href="http://code.google.com/chrome/apps/docs/developers_gu ide.html">Hosted Apps</a></li>
178 <li><a href="themes.html">Themes</a></li>
179 </ul>
180 </li>
181 </ul>
182 </div>
183 <script>
184 initToggles();
185 </script>
186 <div class="g-unit" id="gc-pagecontent">
187 <div id="pageTitle">
188 <h1 class="page_title">chrome.declarativeWebRequest</h1>
189 </div>
190 <!-- TABLE OF CONTENTS -->
191 <div id="toc">
192 <h2>Contents</h2>
193 <ol>
194 <li>
195 <a href="#notes">Notes</a>
196 <ol>
197 </ol>
198 </li><li>
199 <a href="#manifest">Manifest</a>
200 <ol>
201 </ol>
202 </li><li>
203 <a href="#rules">Rules</a>
204 <ol>
205 </ol>
206 </li><li>
207 <a href="#TODO">Todo</a>
208 <ol>
209 </ol>
210 </li>
211 <li>
212 <a href="#apiReference">API reference: chrome.declarativeWebRequ est</a>
213 <ol>
214 <li>
215 <a href="#global-events">Events</a>
216 <ol>
217 <li>
218 <a href="#event-onRequest">onRequest</a>
219 </li>
220 </ol>
221 </li>
222 <li>
223 <a href="#types">Types</a>
224 <ol>
225 <li>
226 <a href="#type-declarativeWebRequest.RedirectByRegEx">declarativ eWebRequest.RedirectByRegEx</a>
227 <ol>
228 </ol>
229 </li><li>
230 <a href="#type-RequestMatcher">RequestMatcher</a>
231 <ol>
232 </ol>
233 </li><li>
234 <a href="#type-RedirectRequest">RedirectRequest</a>
235 <ol>
236 </ol>
237 </li><li>
238 <a href="#type-declarativeWebRequest.RedirectToTransparentImage" >declarativeWebRequest.RedirectToTransparentImage</a>
239 <ol>
240 </ol>
241 </li><li>
242 <a href="#type-declarativeWebRequest.RedirectToEmptyDocument">de clarativeWebRequest.RedirectToEmptyDocument</a>
243 <ol>
244 </ol>
245 </li><li>
246 <a href="#type-CancelRequest">CancelRequest</a>
247 <ol>
248 </ol>
249 </li><li>
250 <a href="#type-declarativeWebRequest.SetRequestHeader">declarati veWebRequest.SetRequestHeader</a>
251 <ol>
252 </ol>
253 </li><li>
254 <a href="#type-declarativeWebRequest.RemoveRequestHeader">declar ativeWebRequest.RemoveRequestHeader</a>
255 <ol>
256 </ol>
257 </li><li>
258 <a href="#type-declarativeWebRequest.AddResponseHeader">declarat iveWebRequest.AddResponseHeader</a>
259 <ol>
260 </ol>
261 </li><li>
262 <a href="#type-declarativeWebRequest.RemoveResponseHeader">decla rativeWebRequest.RemoveResponseHeader</a>
263 <ol>
264 </ol>
265 </li><li>
266 <a href="#type-declarativeWebRequest.IgnoreRules">declarativeWeb Request.IgnoreRules</a>
267 <ol>
268 </ol>
269 </li>
270 </ol>
271 </li>
272 </ol>
273 </li>
274 </ol>
275 </div>
276 <!-- /TABLE OF CONTENTS -->
277 <!-- Standard content lead-in for experimental API pages -->
278 <p class="warning">
279 <!-- Standard content lead-in for APIs that are not yet available on
280 the stable channel. -->
281 <em>Warning:</em> This API is still under development. It is only
282 available for Chrome users on the
283 <span>
284 <strong>dev</strong>
285 <a href="http://www.chromium.org/getting-involved/dev-channel">ear ly
286 release channel</a>.</span>
287 <a href="TODO">Learn more</a>.
288 </p>
289 <!-- STATIC CONTENT PLACEHOLDER -->
290 <div id="static"><!-- BEGIN AUTHORED CONTENT -->
291 <h2 id="notes">Notes</h2>
292 <p>
293 Use the <code>chrome.declarativeWebRequest</code> module to intercept, block, or
294 modify requests in-flight. It is significantly faster than the <a href="webReque st.html"><code>chrome.webRequest</code> API</a> because you can
295 register rules that are evaluated in the browser rather than the
296 JavaScript engine which reduces roundtrip latencies and allows for very high
297 efficiency.
298 </p>
299 <h2 id="manifest">Manifest</h2>
300 <p>
301 You must declare the "declarative" and the "declarativeWebRequest" permission in
302 the <a href="manifest.html">extension manifest</a> to use this API,
303 along with <a href="manifest.html#permissions">host permissions</a> for any
304 hosts whose network requests you want to access.
305 </p>
306 <pre>{
307 "name": "My extension",
308 ...
309 <b> "permissions": [
310 "declarative",
311 "declarativeWebRequest",
312 "*://*.google.com"
313 ]</b>,
314 ...
315 }</pre>
316 <h2 id="rules">Rules</h2>
317 <p>
318 The Declarative Web Request API follows the concepts of the <a href="events.html #declarative">Declarative API</a>. You can register rules to
319 the <code>chrome.declarativeWebRequest.onRequest</code> event object.
320 </p>
321 <p>
322 The Declarative Web Request API supports a single type of match criteria, the
323 <code>RequestMatcher</code>. The <code>RequestMatcher</code> matches network
324 requests if and only if all listed criteria are met. The following
325 <code>RequestMatcher</code> would match a network request when the user enters
326 "http://www.example.com" in the URL bar:
327 </p>
328 <pre>var matcher = new chrome.declarativeWebRequest.RequestMatcher({
329 url: { hostSuffix: 'example.com', schemes: ['http'] },
330 resourceType: 'main_frame'
331 });
332 </pre>
333 <p>
334 Requests to "https://www.example.com" would be rejected by the
335 <code>RequestMatcher</code> due to the scheme. Also all requests for an embedded
336 iframe would be rejected due to the <code>resourceType</code>.
337 </p>
338 <p class="note">
339 <strong>Note:</strong> All conditions and actions are created via a constructor
340 as shown in the example above.
341 </p><p>
342 </p><p>
343 In order to cancel all requests to "example.com", you can define a rule as
344 follows:
345 </p>
346 <pre>var rule = {
347 conditions: [
348 new chrome.declarativeWebRequest.RequestMatcher({
349 url: { hostSuffix: 'example.com' } })
350 ],
351 actions: [
352 new chrome.declarativeWebRequest.CancelRequest()
353 ]};
354 </pre>
355 <p>
356 In order to cancel all requests to "example.com" and "foobar.com", you can add a
357 second condition, as each condition is sufficient to trigger all specified
358 actions:
359 </p>
360 <pre>var rule2 = {
361 conditions: [
362 new chrome.declarativeWebRequest.RequestMatcher({
363 url: { hostSuffix: 'example.com' } }),
364 new chrome.declarativeWebRequest.RequestMatcher({
365 url: { hostSuffix: 'foobar.com' } })
366 ],
367 actions: [
368 new chrome.declarativeWebRequest.CancelRequest()
369 ]};
370 </pre>
371 <p>
372 Register rules as follows:
373 </p>
374 <pre>chrome.declarativeWebRequest.onRequest.addRules([rule2]);
375 </pre>
376 <p class="note">
377 <strong>Note:</strong> You should always register or unregister rules in bulk ra ther than
378 individually because each of these operations recreates internal data
379 structures. This re-creation is computationally expensive but facilitates a
380 very fast URL matching algorithm for hundreds of thousands of URLs.
381 </p>
382 <h2 id="TODO">Todo</h2>
383 <ul>
384 <li>Explain precedences, once we can ignore rules based on their priority
385 (e.g. how can I cancel all requests except for a specific whitelist?)
386 </li><li>Explain when conditions can be evaluated, when actions can be execute d,
387 and when rules can be executed (e.g. you cannot cancel a request when you
388 have received the response already)
389 </li></ul>
390 <!-- END AUTHORED CONTENT -->
391 </div>
392 <!-- API PAGE -->
393 <div class="apiPage">
394 <a name="apiReference"></a>
395 <h2>API reference: chrome.declarativeWebRequest</h2>
396 <!-- PROPERTIES -->
397 <!-- /apiGroup -->
398 <!-- METHODS -->
399 <!-- /apiGroup -->
400 <!-- EVENTS -->
401 <div id="eventsTemplate" class="apiGroup">
402 <a name="global-events"></a>
403 <h3>Events</h3>
404 <!-- iterates over all events -->
405 <div class="apiItem">
406 <a name="event-onRequest"></a>
407 <h4>onRequest</h4>
408 <!-- /description -->
409 <div class="summary">
410 <span class="subdued">chrome.declarativeWebRequest.</span><span> onRequest</span><span class="subdued">.addRules</span>(...);
411 </div>
412 <div class="description">
413 <p>See <a href="events.html#method-Event-addRules"><code>chrome. events.Event.addRules()</code></a>.
414 </p>
415 <!-- CONDITIONS -->
416 <div>
417 <h4>Supported conditions</h4>
418 <dl>
419 <div>
420 <div>
421 <dt>
422 <a>declarativeWebRequest.RequestMatcher</a>
423 </dt>
424 </div>
425 </div>
426 </dl>
427 </div> <!-- /conditions -->
428 <!-- ACTIONS -->
429 <div>
430 <h4>Supported actions</h4>
431 <dl>
432 <div>
433 <div>
434 <dt>
435 <a href="declarativeWebRequest.html#type-declarativeWebRequest.AddRe sponseHeader">declarativeWebRequest.AddResponseHeader</a>
436 </dt>
437 <dd class="todo">
438 Undocumented.
439 </dd>
440 </div>
441 </div><div>
442 <div>
443 <dt>
444 <a>declarativeWebRequest.CancelRequest</a>
445 </dt>
446 </div>
447 </div><div>
448 <div>
449 <dt>
450 <a>declarativeWebRequest.RedirectRequest</a>
451 </dt>
452 </div>
453 </div><div>
454 <div>
455 <dt>
456 <a href="declarativeWebRequest.html#type-declarativeWebRequest.Redir ectToTransparentImage">declarativeWebRequest.RedirectToTransparentImage</a>
457 </dt>
458 <dd class="todo">
459 Undocumented.
460 </dd>
461 </div>
462 </div><div>
463 <div>
464 <dt>
465 <a href="declarativeWebRequest.html#type-declarativeWebRequest.Redir ectToEmptyDocument">declarativeWebRequest.RedirectToEmptyDocument</a>
466 </dt>
467 <dd class="todo">
468 Undocumented.
469 </dd>
470 </div>
471 </div><div>
472 <div>
473 <dt>
474 <a href="declarativeWebRequest.html#type-declarativeWebRequest.Redir ectByRegEx">declarativeWebRequest.RedirectByRegEx</a>
475 </dt>
476 <dd class="todo">
477 Undocumented.
478 </dd>
479 </div>
480 </div><div>
481 <div>
482 <dt>
483 <a href="declarativeWebRequest.html#type-declarativeWebRequest.SetRe questHeader">declarativeWebRequest.SetRequestHeader</a>
484 </dt>
485 <dd class="todo">
486 Undocumented.
487 </dd>
488 </div>
489 </div><div>
490 <div>
491 <dt>
492 <a href="declarativeWebRequest.html#type-declarativeWebRequest.Remov eRequestHeader">declarativeWebRequest.RemoveRequestHeader</a>
493 </dt>
494 <dd class="todo">
495 Undocumented.
496 </dd>
497 </div>
498 </div><div>
499 <div>
500 <dt>
501 <a href="declarativeWebRequest.html#type-declarativeWebRequest.Remov eResponseHeader">declarativeWebRequest.RemoveResponseHeader</a>
502 </dt>
503 <dd class="todo">
504 Undocumented.
505 </dd>
506 </div>
507 </div><div>
508 <div>
509 <dt>
510 <a href="declarativeWebRequest.html#type-declarativeWebRequest.Ignor eRules">declarativeWebRequest.IgnoreRules</a>
511 </dt>
512 <dd class="todo">
513 Undocumented.
514 </dd>
515 </div>
516 </div>
517 </dl>
518 </div> <!-- /actions -->
519 </div> <!-- /description -->
520 </div> <!-- /apiItem -->
521 </div> <!-- /apiGroup -->
522 <!-- TYPES -->
523 <div class="apiGroup">
524 <a name="types"></a>
525 <h3 id="types">Types</h3>
526 <!-- iterates over all types -->
527 <div class="apiItem">
528 <a name="type-declarativeWebRequest.RedirectByRegEx"></a>
529 <h4>declarativeWebRequest.RedirectByRegEx</h4>
530 <div>
531 <dt>
532 <em>
533 <!-- TYPE -->
534 <div style="display:inline">
535 (
536 <span id="typeTemplate">
537 <span>
538 <span>object</span>
539 </span>
540 </span>
541 )
542 </div>
543 </em>
544 </dt>
545 <dd>Redirects a request by applying a regular expression on the URL. T he regular expressions use the <a href="http://code.google.com/p/re2/wiki/Syntax ">RE2 syntax</a>.</dd>
546 <!-- OBJECT PROPERTIES -->
547 <dd>
548 <dl>
549 <div>
550 <div>
551 <dt>
552 <var>from</var>
553 <em>
554 <!-- TYPE -->
555 <div style="display:inline">
556 (
557 <span id="typeTemplate">
558 <span>
559 <span>string</span>
560 </span>
561 </span>
562 )
563 </div>
564 </em>
565 </dt>
566 <dd>A match pattern that may contain capture groups. Capture groups ar e referenced in the Perl syntax ($1, $2, ...) instead of the RE2 syntax (\1, \2, ...) in order to be closer to JavaScript Regular Expressions.</dd>
567 <!-- OBJECT PROPERTIES -->
568 <!-- OBJECT METHODS -->
569 <!-- OBJECT EVENT FIELDS -->
570 <!-- FUNCTION PARAMETERS -->
571 </div>
572 </div><div>
573 <div>
574 <dt>
575 <var>to</var>
576 <em>
577 <!-- TYPE -->
578 <div style="display:inline">
579 (
580 <span id="typeTemplate">
581 <span>
582 <span>string</span>
583 </span>
584 </span>
585 )
586 </div>
587 </em>
588 </dt>
589 <dd>Destination pattern.</dd>
590 <!-- OBJECT PROPERTIES -->
591 <!-- OBJECT METHODS -->
592 <!-- OBJECT EVENT FIELDS -->
593 <!-- FUNCTION PARAMETERS -->
594 </div>
595 </div>
596 </dl>
597 </dd>
598 <!-- OBJECT METHODS -->
599 <!-- OBJECT EVENT FIELDS -->
600 <!-- FUNCTION PARAMETERS -->
601 </div>
602 </div><div class="apiItem">
603 <a name="type-RequestMatcher"></a>
604 <h4>RequestMatcher</h4>
605 <div>
606 <dt>
607 <em>
608 <!-- TYPE -->
609 <div style="display:inline">
610 (
611 <span id="typeTemplate">
612 <span>
613 <span>object</span>
614 </span>
615 </span>
616 )
617 </div>
618 </em>
619 </dt>
620 <dd>Matches network events by various criteria.</dd>
621 <!-- OBJECT PROPERTIES -->
622 <dd>
623 <dl>
624 <div>
625 <div>
626 <dt>
627 <var>url</var>
628 <em>
629 <!-- TYPE -->
630 <div style="display:inline">
631 (
632 <span class="optional">optional</span>
633 <span id="typeTemplate">
634 <span>
635 <a>events.UrlFilter</a>
636 </span>
637 </span>
638 )
639 </div>
640 </em>
641 </dt>
642 <dd>Matches if the condition of the UrlFilter are fulfilled for the UR L of the request.</dd>
643 <!-- OBJECT PROPERTIES -->
644 <!-- OBJECT METHODS -->
645 <!-- OBJECT EVENT FIELDS -->
646 <!-- FUNCTION PARAMETERS -->
647 </div>
648 </div><div>
649 <div>
650 <dt>
651 <var>resourceType</var>
652 <em>
653 <!-- TYPE -->
654 <div style="display:inline">
655 (
656 <span class="optional">optional</span>
657 <span id="typeTemplate">
658 <span>
659 <span>
660 array of <span><span>
661 <span>
662 <span>string</span>
663 <span>["main_frame", "sub_frame", "stylesheet", "script" , "image", "object", "xmlhttprequest", "other"]</span>
664 </span>
665 </span></span>
666 </span>
667 </span>
668 </span>
669 )
670 </div>
671 </em>
672 </dt>
673 <dd>Matches if the request type of a request is contained in the list. Requests that cannot match any of the types will be filtered out.</dd>
674 <!-- OBJECT PROPERTIES -->
675 <!-- OBJECT METHODS -->
676 <!-- OBJECT EVENT FIELDS -->
677 <!-- FUNCTION PARAMETERS -->
678 </div>
679 </div><div>
680 <div>
681 <dt>
682 <var>instanceType</var>
683 <em>
684 <!-- TYPE -->
685 <div style="display:inline">
686 (
687 <span class="enum">enumerated</span>
688 <span id="typeTemplate">
689 <span>
690 <span>string</span>
691 <span>["declarativeWebRequest.RequestMatcher"]</span>
692 </span>
693 </span>
694 )
695 </div>
696 </em>
697 </dt>
698 <dd class="todo">
699 Undocumented.
700 </dd>
701 <!-- OBJECT PROPERTIES -->
702 <!-- OBJECT METHODS -->
703 <!-- OBJECT EVENT FIELDS -->
704 <!-- FUNCTION PARAMETERS -->
705 </div>
706 </div>
707 </dl>
708 </dd>
709 <!-- OBJECT METHODS -->
710 <!-- OBJECT EVENT FIELDS -->
711 <!-- FUNCTION PARAMETERS -->
712 </div>
713 </div><div class="apiItem">
714 <a name="type-RedirectRequest"></a>
715 <h4>RedirectRequest</h4>
716 <div>
717 <dt>
718 <em>
719 <!-- TYPE -->
720 <div style="display:inline">
721 (
722 <span id="typeTemplate">
723 <span>
724 <span>object</span>
725 </span>
726 </span>
727 )
728 </div>
729 </em>
730 </dt>
731 <dd>Declarative event action that redirects a network request.</dd>
732 <!-- OBJECT PROPERTIES -->
733 <dd>
734 <dl>
735 <div>
736 <div>
737 <dt>
738 <var>instanceType</var>
739 <em>
740 <!-- TYPE -->
741 <div style="display:inline">
742 (
743 <span class="enum">enumerated</span>
744 <span id="typeTemplate">
745 <span>
746 <span>string</span>
747 <span>["declarativeWebRequest.RedirectRequest"]</span>
748 </span>
749 </span>
750 )
751 </div>
752 </em>
753 </dt>
754 <dd class="todo">
755 Undocumented.
756 </dd>
757 <!-- OBJECT PROPERTIES -->
758 <!-- OBJECT METHODS -->
759 <!-- OBJECT EVENT FIELDS -->
760 <!-- FUNCTION PARAMETERS -->
761 </div>
762 </div><div>
763 <div>
764 <dt>
765 <var>redirectUrl</var>
766 <em>
767 <!-- TYPE -->
768 <div style="display:inline">
769 (
770 <span id="typeTemplate">
771 <span>
772 <span>string</span>
773 </span>
774 </span>
775 )
776 </div>
777 </em>
778 </dt>
779 <dd>Destination to where the request is redirected.</dd>
780 <!-- OBJECT PROPERTIES -->
781 <!-- OBJECT METHODS -->
782 <!-- OBJECT EVENT FIELDS -->
783 <!-- FUNCTION PARAMETERS -->
784 </div>
785 </div>
786 </dl>
787 </dd>
788 <!-- OBJECT METHODS -->
789 <!-- OBJECT EVENT FIELDS -->
790 <!-- FUNCTION PARAMETERS -->
791 </div>
792 </div><div class="apiItem">
793 <a name="type-declarativeWebRequest.RedirectToTransparentImage"></ a>
794 <h4>declarativeWebRequest.RedirectToTransparentImage</h4>
795 <div>
796 <dt>
797 <em>
798 <!-- TYPE -->
799 <div style="display:inline">
800 (
801 <span id="typeTemplate">
802 <span>
803 <span>object</span>
804 </span>
805 </span>
806 )
807 </div>
808 </em>
809 </dt>
810 <dd>Declarative event action that redirects a network request to a tra nsparent image.</dd>
811 <!-- OBJECT PROPERTIES -->
812 <dd>
813 <dl>
814 </dl>
815 </dd>
816 <!-- OBJECT METHODS -->
817 <!-- OBJECT EVENT FIELDS -->
818 <!-- FUNCTION PARAMETERS -->
819 </div>
820 </div><div class="apiItem">
821 <a name="type-declarativeWebRequest.RedirectToEmptyDocument"></a>
822 <h4>declarativeWebRequest.RedirectToEmptyDocument</h4>
823 <div>
824 <dt>
825 <em>
826 <!-- TYPE -->
827 <div style="display:inline">
828 (
829 <span id="typeTemplate">
830 <span>
831 <span>object</span>
832 </span>
833 </span>
834 )
835 </div>
836 </em>
837 </dt>
838 <dd>Declarative event action that redirects a network request to an em pty document.</dd>
839 <!-- OBJECT PROPERTIES -->
840 <dd>
841 <dl>
842 </dl>
843 </dd>
844 <!-- OBJECT METHODS -->
845 <!-- OBJECT EVENT FIELDS -->
846 <!-- FUNCTION PARAMETERS -->
847 </div>
848 </div><div class="apiItem">
849 <a name="type-CancelRequest"></a>
850 <h4>CancelRequest</h4>
851 <div>
852 <dt>
853 <em>
854 <!-- TYPE -->
855 <div style="display:inline">
856 (
857 <span id="typeTemplate">
858 <span>
859 <span>object</span>
860 </span>
861 </span>
862 )
863 </div>
864 </em>
865 </dt>
866 <dd>Declarative event action that cancels a network request.</dd>
867 <!-- OBJECT PROPERTIES -->
868 <dd>
869 <dl>
870 <div>
871 <div>
872 <dt>
873 <var>instanceType</var>
874 <em>
875 <!-- TYPE -->
876 <div style="display:inline">
877 (
878 <span class="enum">enumerated</span>
879 <span id="typeTemplate">
880 <span>
881 <span>string</span>
882 <span>["declarativeWebRequest.CancelRequest"]</span>
883 </span>
884 </span>
885 )
886 </div>
887 </em>
888 </dt>
889 <dd class="todo">
890 Undocumented.
891 </dd>
892 <!-- OBJECT PROPERTIES -->
893 <!-- OBJECT METHODS -->
894 <!-- OBJECT EVENT FIELDS -->
895 <!-- FUNCTION PARAMETERS -->
896 </div>
897 </div>
898 </dl>
899 </dd>
900 <!-- OBJECT METHODS -->
901 <!-- OBJECT EVENT FIELDS -->
902 <!-- FUNCTION PARAMETERS -->
903 </div>
904 </div><div class="apiItem">
905 <a name="type-declarativeWebRequest.SetRequestHeader"></a>
906 <h4>declarativeWebRequest.SetRequestHeader</h4>
907 <div>
908 <dt>
909 <em>
910 <!-- TYPE -->
911 <div style="display:inline">
912 (
913 <span id="typeTemplate">
914 <span>
915 <span>object</span>
916 </span>
917 </span>
918 )
919 </div>
920 </em>
921 </dt>
922 <dd>Sets the request header of the specified name to the specified val ue. If a header with the specified name did not exist before, a new one is creat ed. Header name comparison is always case-insensitive. Each request header name occurs only once in each request.</dd>
923 <!-- OBJECT PROPERTIES -->
924 <dd>
925 <dl>
926 <div>
927 <div>
928 <dt>
929 <var>name</var>
930 <em>
931 <!-- TYPE -->
932 <div style="display:inline">
933 (
934 <span id="typeTemplate">
935 <span>
936 <span>string</span>
937 </span>
938 </span>
939 )
940 </div>
941 </em>
942 </dt>
943 <dd>HTTP request header name.</dd>
944 <!-- OBJECT PROPERTIES -->
945 <!-- OBJECT METHODS -->
946 <!-- OBJECT EVENT FIELDS -->
947 <!-- FUNCTION PARAMETERS -->
948 </div>
949 </div><div>
950 <div>
951 <dt>
952 <var>value</var>
953 <em>
954 <!-- TYPE -->
955 <div style="display:inline">
956 (
957 <span id="typeTemplate">
958 <span>
959 <span>string</span>
960 </span>
961 </span>
962 )
963 </div>
964 </em>
965 </dt>
966 <dd>HTTP request header value.</dd>
967 <!-- OBJECT PROPERTIES -->
968 <!-- OBJECT METHODS -->
969 <!-- OBJECT EVENT FIELDS -->
970 <!-- FUNCTION PARAMETERS -->
971 </div>
972 </div>
973 </dl>
974 </dd>
975 <!-- OBJECT METHODS -->
976 <!-- OBJECT EVENT FIELDS -->
977 <!-- FUNCTION PARAMETERS -->
978 </div>
979 </div><div class="apiItem">
980 <a name="type-declarativeWebRequest.RemoveRequestHeader"></a>
981 <h4>declarativeWebRequest.RemoveRequestHeader</h4>
982 <div>
983 <dt>
984 <em>
985 <!-- TYPE -->
986 <div style="display:inline">
987 (
988 <span id="typeTemplate">
989 <span>
990 <span>object</span>
991 </span>
992 </span>
993 )
994 </div>
995 </em>
996 </dt>
997 <dd>Removes the request header of the specified name. Do not use SetRe questHeader and RemoveRequestHeader with the same header name on the same reques t. Each request header name occurs only once in each request.</dd>
998 <!-- OBJECT PROPERTIES -->
999 <dd>
1000 <dl>
1001 <div>
1002 <div>
1003 <dt>
1004 <var>name</var>
1005 <em>
1006 <!-- TYPE -->
1007 <div style="display:inline">
1008 (
1009 <span id="typeTemplate">
1010 <span>
1011 <span>string</span>
1012 </span>
1013 </span>
1014 )
1015 </div>
1016 </em>
1017 </dt>
1018 <dd>HTTP request header name (case-insensitive).</dd>
1019 <!-- OBJECT PROPERTIES -->
1020 <!-- OBJECT METHODS -->
1021 <!-- OBJECT EVENT FIELDS -->
1022 <!-- FUNCTION PARAMETERS -->
1023 </div>
1024 </div>
1025 </dl>
1026 </dd>
1027 <!-- OBJECT METHODS -->
1028 <!-- OBJECT EVENT FIELDS -->
1029 <!-- FUNCTION PARAMETERS -->
1030 </div>
1031 </div><div class="apiItem">
1032 <a name="type-declarativeWebRequest.AddResponseHeader"></a>
1033 <h4>declarativeWebRequest.AddResponseHeader</h4>
1034 <div>
1035 <dt>
1036 <em>
1037 <!-- TYPE -->
1038 <div style="display:inline">
1039 (
1040 <span id="typeTemplate">
1041 <span>
1042 <span>object</span>
1043 </span>
1044 </span>
1045 )
1046 </div>
1047 </em>
1048 </dt>
1049 <dd>Adds the response header to the response of this web request. As m ultiple response headers may share the same name, you need to first remove and t hen add a new response header in order to replace one.</dd>
1050 <!-- OBJECT PROPERTIES -->
1051 <dd>
1052 <dl>
1053 <div>
1054 <div>
1055 <dt>
1056 <var>name</var>
1057 <em>
1058 <!-- TYPE -->
1059 <div style="display:inline">
1060 (
1061 <span id="typeTemplate">
1062 <span>
1063 <span>string</span>
1064 </span>
1065 </span>
1066 )
1067 </div>
1068 </em>
1069 </dt>
1070 <dd>HTTP response header name.</dd>
1071 <!-- OBJECT PROPERTIES -->
1072 <!-- OBJECT METHODS -->
1073 <!-- OBJECT EVENT FIELDS -->
1074 <!-- FUNCTION PARAMETERS -->
1075 </div>
1076 </div><div>
1077 <div>
1078 <dt>
1079 <var>value</var>
1080 <em>
1081 <!-- TYPE -->
1082 <div style="display:inline">
1083 (
1084 <span id="typeTemplate">
1085 <span>
1086 <span>string</span>
1087 </span>
1088 </span>
1089 )
1090 </div>
1091 </em>
1092 </dt>
1093 <dd>HTTP response header value.</dd>
1094 <!-- OBJECT PROPERTIES -->
1095 <!-- OBJECT METHODS -->
1096 <!-- OBJECT EVENT FIELDS -->
1097 <!-- FUNCTION PARAMETERS -->
1098 </div>
1099 </div>
1100 </dl>
1101 </dd>
1102 <!-- OBJECT METHODS -->
1103 <!-- OBJECT EVENT FIELDS -->
1104 <!-- FUNCTION PARAMETERS -->
1105 </div>
1106 </div><div class="apiItem">
1107 <a name="type-declarativeWebRequest.RemoveResponseHeader"></a>
1108 <h4>declarativeWebRequest.RemoveResponseHeader</h4>
1109 <div>
1110 <dt>
1111 <em>
1112 <!-- TYPE -->
1113 <div style="display:inline">
1114 (
1115 <span id="typeTemplate">
1116 <span>
1117 <span>object</span>
1118 </span>
1119 </span>
1120 )
1121 </div>
1122 </em>
1123 </dt>
1124 <dd>Removes all response headers of the specified names and values.</d d>
1125 <!-- OBJECT PROPERTIES -->
1126 <dd>
1127 <dl>
1128 <div>
1129 <div>
1130 <dt>
1131 <var>name</var>
1132 <em>
1133 <!-- TYPE -->
1134 <div style="display:inline">
1135 (
1136 <span id="typeTemplate">
1137 <span>
1138 <span>string</span>
1139 </span>
1140 </span>
1141 )
1142 </div>
1143 </em>
1144 </dt>
1145 <dd>HTTP request header name (case-insensitive).</dd>
1146 <!-- OBJECT PROPERTIES -->
1147 <!-- OBJECT METHODS -->
1148 <!-- OBJECT EVENT FIELDS -->
1149 <!-- FUNCTION PARAMETERS -->
1150 </div>
1151 </div><div>
1152 <div>
1153 <dt>
1154 <var>value</var>
1155 <em>
1156 <!-- TYPE -->
1157 <div style="display:inline">
1158 (
1159 <span class="optional">optional</span>
1160 <span id="typeTemplate">
1161 <span>
1162 <span>string</span>
1163 </span>
1164 </span>
1165 )
1166 </div>
1167 </em>
1168 </dt>
1169 <dd>HTTP request header value (case-insensitive).</dd>
1170 <!-- OBJECT PROPERTIES -->
1171 <!-- OBJECT METHODS -->
1172 <!-- OBJECT EVENT FIELDS -->
1173 <!-- FUNCTION PARAMETERS -->
1174 </div>
1175 </div>
1176 </dl>
1177 </dd>
1178 <!-- OBJECT METHODS -->
1179 <!-- OBJECT EVENT FIELDS -->
1180 <!-- FUNCTION PARAMETERS -->
1181 </div>
1182 </div><div class="apiItem">
1183 <a name="type-declarativeWebRequest.IgnoreRules"></a>
1184 <h4>declarativeWebRequest.IgnoreRules</h4>
1185 <div>
1186 <dt>
1187 <em>
1188 <!-- TYPE -->
1189 <div style="display:inline">
1190 (
1191 <span id="typeTemplate">
1192 <span>
1193 <span>object</span>
1194 </span>
1195 </span>
1196 )
1197 </div>
1198 </em>
1199 </dt>
1200 <dd>Masks all rules that match the specified criteria.</dd>
1201 <!-- OBJECT PROPERTIES -->
1202 <dd>
1203 <dl>
1204 <div>
1205 <div>
1206 <dt>
1207 <var>lowerPriorityThan</var>
1208 <em>
1209 <!-- TYPE -->
1210 <div style="display:inline">
1211 (
1212 <span id="typeTemplate">
1213 <span>
1214 <span>integer</span>
1215 </span>
1216 </span>
1217 )
1218 </div>
1219 </em>
1220 </dt>
1221 <dd>If set, rules with a lower priority than the specified value are i gnored. This boundary is not persited, it affects only rules and their actions o f the same network request stage. TODO(battre): Explain network request stages.< /dd>
1222 <!-- OBJECT PROPERTIES -->
1223 <!-- OBJECT METHODS -->
1224 <!-- OBJECT EVENT FIELDS -->
1225 <!-- FUNCTION PARAMETERS -->
1226 </div>
1227 </div>
1228 </dl>
1229 </dd>
1230 <!-- OBJECT METHODS -->
1231 <!-- OBJECT EVENT FIELDS -->
1232 <!-- FUNCTION PARAMETERS -->
1233 </div>
1234 </div> <!-- /apiItem -->
1235 </div> <!-- /apiGroup -->
1236 </div> <!-- /apiPage -->
1237 </div> <!-- /gc-pagecontent -->
1238 </div> <!-- /g-section -->
1239 </div> <!-- /codesiteContent -->
1240 <div id="gc-footer" --="">
1241 <div class="text">
1242 <p>
1243 Except as otherwise <a href="http://code.google.com/policies.html#restrictions ">noted</a>,
1244 the content of this page is licensed under the <a rel="license" href="http://c reativecommons.org/licenses/by/3.0/">Creative Commons
1245 Attribution 3.0 License</a>, and code samples are licensed under the
1246 <a rel="license" href="http://code.google.com/google_bsd_license.html">BSD Lic ense</a>.
1247 </p>
1248 <p>
1249 ©2011 Google
1250 </p>
1251 <!-- begin analytics -->
1252 <script src="https://www.google-analytics.com/urchin.js" type="text/javascript"> </script>
1253 <script src="https://www.google-analytics.com/ga.js" type="text/javascript"></sc ript>
1254 <script type="text/javascript">
1255 // chrome doc tracking
1256 try {
1257 var engdocs = _gat._getTracker("YT-10763712-2");
1258 engdocs._trackPageview();
1259 } catch(err) {}
1260 // code.google.com site-wide tracking
1261 try {
1262 _uacct="UA-18071-1";
1263 _uanchor=1;
1264 _uff=0;
1265 urchinTracker();
1266 }
1267 catch(e) {/* urchinTracker not available. */}
1268 </script>
1269 <!-- end analytics -->
1270 </div>
1271 </div> <!-- /gc-footer -->
1272 </div> <!-- /gc-container -->
1273 </body></html>
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/debugger.html ('k') | chrome/common/extensions/docs/devguide.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698