OLD | NEW |
1 <!DOCTYPE html><!-- This page is a placeholder for generated extensions api doc.
Note: | 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 | 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 | 3 across api docs and should be edited only with knowledge of the |
4 templating mechanism. | 4 templating mechanism. |
5 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a | 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 | 6 browser, it will be re-generated from the template, json schema and |
7 authored overview content. | 7 authored overview content. |
8 4) The <body>.innerHTML is also generated by an offline step so that this | 8 4) The <body>.innerHTML is also generated by an offline step so that this |
9 page may easily be indexed by search engines. | 9 page may easily be indexed by search engines. |
10 --><html xmlns="http://www.w3.org/1999/xhtml"><head> | 10 --><html xmlns="http://www.w3.org/1999/xhtml"><head> |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 For example:</p> | 295 For example:</p> |
296 <pre>{ | 296 <pre>{ |
297 "name": "My extension", | 297 "name": "My extension", |
298 ... | 298 ... |
299 <b>"permissions": [ | 299 <b>"permissions": [ |
300 "webRequest", | 300 "webRequest", |
301 "*://*.google.com" | 301 "*://*.google.com" |
302 ]</b>, | 302 ]</b>, |
303 ... | 303 ... |
304 }</pre> | 304 }</pre> |
305 <p class="note"> | |
306 <b>Node:</b> If you request the "webRequestBlocking" permission, web requests | |
307 are delayed until the background page of your extension has been loaded. This | |
308 allows you to register event listeners before any web requests are processed. | |
309 In order to avoid deadlocks, you must not start synchronous XmlHttpRequests or | |
310 include scripts from the internet via <code><script src="..."></code> tags | |
311 in your background page. | |
312 </p> | |
313 <h2 id="life_cycle">Life cycle of requests</h2> | 305 <h2 id="life_cycle">Life cycle of requests</h2> |
314 <p> | 306 <p> |
315 The web request API defines a set of events that follow the life cycle of a web | 307 The web request API defines a set of events that follow the life cycle of a web |
316 request. You can use these events to observe and analyze traffic. Certain | 308 request. You can use these events to observe and analyze traffic. Certain |
317 synchronous events will allow you to intercept, block, or modify a request. | 309 synchronous events will allow you to intercept, block, or modify a request. |
318 </p> | 310 </p> |
319 <p> | 311 <p> |
320 The event life cycle for successful requests is illustrated here, followed by | 312 The event life cycle for successful requests is illustrated here, followed by |
321 event definitions:<br> | 313 event definitions:<br> |
322 <img src="../images/webrequestapi.png" width="385" height="503" alt="Life cycle
of a web request from the perspective of the webrequest API" style="margin-left:
auto; margin-right: auto; display: block"> | 314 <img src="../images/webrequestapi.png" width="385" height="503" alt="Life cycle
of a web request from the perspective of the webrequest API" style="margin-left:
auto; margin-right: auto; display: block"> |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 <code>https://</code>, | 396 <code>https://</code>, |
405 <code>ftp://</code>, | 397 <code>ftp://</code>, |
406 <code>file://</code>, or | 398 <code>file://</code>, or |
407 <code>chrome-extension://</code>. | 399 <code>chrome-extension://</code>. |
408 In addition, even certain requests with URLs using one of the above schemes | 400 In addition, even certain requests with URLs using one of the above schemes |
409 are hidden, e.g., | 401 are hidden, e.g., |
410 <code>chrome-extension://other_extension_id</code> where | 402 <code>chrome-extension://other_extension_id</code> where |
411 <code>other_extension_id</code> is not the ID of the extension to handle | 403 <code>other_extension_id</code> is not the ID of the extension to handle |
412 the request, | 404 the request, |
413 <code>https://www.google.com/chrome</code>, | 405 <code>https://www.google.com/chrome</code>, |
414 and others (this list is not complete). | 406 and others (this list is not complete). Also synchronous XMLHttpRequests from |
| 407 your extension are hidden from blocking event handlers in order to prevent |
| 408 deadlocks. |
415 </p> | 409 </p> |
416 <h2 id="concepts">Concepts</h2> | 410 <h2 id="concepts">Concepts</h2> |
417 <p>As the following sections explain, events in the web request API use request | 411 <p>As the following sections explain, events in the web request API use request |
418 IDs, and you can optionally specify filters and extra information when you | 412 IDs, and you can optionally specify filters and extra information when you |
419 register event listeners.</p> | 413 register event listeners.</p> |
420 <h3 id="Request IDs">Request IDs</h3> | 414 <h3 id="Request IDs">Request IDs</h3> |
421 <p>Each request is identified by a request ID. This ID is unique within a | 415 <p>Each request is identified by a request ID. This ID is unique within a |
422 browser session and the context of an extension. It remains constant during the | 416 browser session and the context of an extension. It remains constant during the |
423 the life cycle of a request and can be used to match events for the same | 417 the life cycle of a request and can be used to match events for the same |
424 request. Note that several HTTP requests are mapped to one web request in case | 418 request. Note that several HTTP requests are mapped to one web request in case |
(...skipping 4239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4664 _uff=0; | 4658 _uff=0; |
4665 urchinTracker(); | 4659 urchinTracker(); |
4666 } | 4660 } |
4667 catch(e) {/* urchinTracker not available. */} | 4661 catch(e) {/* urchinTracker not available. */} |
4668 </script> | 4662 </script> |
4669 <!-- end analytics --> | 4663 <!-- end analytics --> |
4670 </div> | 4664 </div> |
4671 </div> <!-- /gc-footer --> | 4665 </div> <!-- /gc-footer --> |
4672 </div> <!-- /gc-container --> | 4666 </div> <!-- /gc-container --> |
4673 </body></html> | 4667 </body></html> |
OLD | NEW |