OLD | NEW |
1 <h2 id="notes">Notes</h2> | 1 <h2 id="notes">Notes</h2> |
2 | 2 |
3 <p> | 3 <p> |
4 Use the <code>chrome.declarativeWebRequest</code> module to intercept, block, or | 4 Use the <code>chrome.declarativeWebRequest</code> module to intercept, block, or |
5 modify requests in-flight. It is significantly faster than the <a | 5 modify requests in-flight. It is significantly faster than the <a |
6 href="webRequest.html"><code>chrome.webRequest</code> API</a> because you can | 6 href="webRequest.html"><code>chrome.webRequest</code> API</a> because you can |
7 register rules that are evaluated in the browser rather than the | 7 register rules that are evaluated in the browser rather than the |
8 JavaScript engine which reduces roundtrip latencies and allows for very high | 8 JavaScript engine which reduces roundtrip latencies and allows for very high |
9 efficiency. | 9 efficiency. |
10 </p> | 10 </p> |
(...skipping 18 matching lines...) Expand all Loading... |
29 }</pre> | 29 }</pre> |
30 | 30 |
31 <p> | 31 <p> |
32 Note that certain types of non-sensitive requests do not require host | 32 Note that certain types of non-sensitive requests do not require host |
33 permissions: | 33 permissions: |
34 <ul> | 34 <ul> |
35 <li><code>CancelRequest</code> | 35 <li><code>CancelRequest</code> |
36 <li><code>IgnoreRules</code> | 36 <li><code>IgnoreRules</code> |
37 <li><code>RedirectToEmptyDocument</code> | 37 <li><code>RedirectToEmptyDocument</code> |
38 <li><code>RedirectToTransparentImage</code> | 38 <li><code>RedirectToTransparentImage</code> |
39 <li><code>RedirectByRegex</code> when the redirect destination has | 39 <li><code>RedirectByRegEx</code> when the redirect destination has |
40 the same domain as the original request | 40 the same domain as the original request |
41 <li><code>RedirectRequest</code> when the redirect destination has | 41 <li><code>RedirectRequest</code> when the redirect destination has |
42 the same domain as the original request | 42 the same domain as the original request |
43 </ul> | 43 </ul> |
44 | 44 |
45 <h2 id="rules">Rules</h2> | 45 <h2 id="rules">Rules</h2> |
46 | 46 |
47 <p> | 47 <p> |
48 The Declarative Web Request API follows the concepts of the <a | 48 The Declarative Web Request API follows the concepts of the <a |
49 href="events.html#declarative">Declarative API</a>. You can register rules to | 49 href="events.html#declarative">Declarative API</a>. You can register rules to |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 chrome.declarativeWebRequest.onRequest.addRules([rule1, rule2]); | 230 chrome.declarativeWebRequest.onRequest.addRules([rule1, rule2]); |
231 </pre> | 231 </pre> |
232 | 232 |
233 <p> | 233 <p> |
234 It is important to recognize that the <code>IgnoreRules</code> action is not | 234 It is important to recognize that the <code>IgnoreRules</code> action is not |
235 persisted across <a href="#evaluation">request stages</a>. All conditions of | 235 persisted across <a href="#evaluation">request stages</a>. All conditions of |
236 all rules are evaluated at each stage of a web request. If an | 236 all rules are evaluated at each stage of a web request. If an |
237 <code>IgnoreRules</code> action is executed, it applies only to other actions | 237 <code>IgnoreRules</code> action is executed, it applies only to other actions |
238 that are executed for the same web request in the same stage. | 238 that are executed for the same web request in the same stage. |
239 </p> | 239 </p> |
OLD | NEW |