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

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

Issue 10825212: Support also excluding content types in declarative webrequest conditions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ' Created 8 years, 4 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
1 <!-- BEGIN AUTHORED CONTENT --> 1 <!-- BEGIN AUTHORED CONTENT -->
2 2
3 <h2 id="notes">Notes</h2> 3 <h2 id="notes">Notes</h2>
4 4
5 <p> 5 <p>
6 Use the <code>chrome.declarativeWebRequest</code> module to intercept, block, or 6 Use the <code>chrome.declarativeWebRequest</code> module to intercept, block, or
7 modify requests in-flight. It is significantly faster than the <a 7 modify requests in-flight. It is significantly faster than the <a
8 href="webRequest.html"><code>chrome.webRequest</code> API</a> because you can 8 href="webRequest.html"><code>chrome.webRequest</code> API</a> because you can
9 register rules that are evaluated in the browser rather than the 9 register rules that are evaluated in the browser rather than the
10 JavaScript engine which reduces roundtrip latencies and allows for very high 10 JavaScript engine which reduces roundtrip latencies and allows for very high
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 The Declarative Web Request API supports a single type of match criteria, the 42 The Declarative Web Request API supports a single type of match criteria, the
43 <code>RequestMatcher</code>. The <code>RequestMatcher</code> matches network 43 <code>RequestMatcher</code>. The <code>RequestMatcher</code> matches network
44 requests if and only if all listed criteria are met. The following 44 requests if and only if all listed criteria are met. The following
45 <code>RequestMatcher</code> would match a network request when the user enters 45 <code>RequestMatcher</code> would match a network request when the user enters
46 "http://www.example.com" in the URL bar: 46 "http://www.example.com" in the URL bar:
47 </p> 47 </p>
48 48
49 <pre> 49 <pre>
50 var matcher = new chrome.declarativeWebRequest.RequestMatcher({ 50 var matcher = new chrome.declarativeWebRequest.RequestMatcher({
51 url: { hostSuffix: 'example.com', schemes: ['http'] }, 51 url: { hostSuffix: 'example.com', schemes: ['http'] },
52 resourceType: 'main_frame' 52 resourceType: ['main_frame']
53 }); 53 });
54 </pre> 54 </pre>
55 55
56 <p> 56 <p>
57 Requests to "https://www.example.com" would be rejected by the 57 Requests to "https://www.example.com" would be rejected by the
58 <code>RequestMatcher</code> due to the scheme. Also all requests for an embedded 58 <code>RequestMatcher</code> due to the scheme. Also all requests for an embedded
59 iframe would be rejected due to the <code>resourceType</code>. 59 iframe would be rejected due to the <code>resourceType</code>.
60 </p> 60 </p>
61 61
62 <p class="note"> 62 <p class="note">
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 <h2 id="TODO">Todo</h2> 114 <h2 id="TODO">Todo</h2>
115 <ul> 115 <ul>
116 <li>Explain precedences, once we can ignore rules based on their priority 116 <li>Explain precedences, once we can ignore rules based on their priority
117 (e.g. how can I cancel all requests except for a specific whitelist?) 117 (e.g. how can I cancel all requests except for a specific whitelist?)
118 <li>Explain when conditions can be evaluated, when actions can be executed, 118 <li>Explain when conditions can be evaluated, when actions can be executed,
119 and when rules can be executed (e.g. you cannot cancel a request when you 119 and when rules can be executed (e.g. you cannot cancel a request when you
120 have received the response already) 120 have received the response already)
121 </ul> 121 </ul>
122 122
123 <!-- END AUTHORED CONTENT --> 123 <!-- END AUTHORED CONTENT -->
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/samples.json ('k') | chrome/test/data/extensions/api_test/webrequest/test_declarative.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698