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

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

Issue 7978032: Fix webRequest documentation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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
« no previous file with comments | « chrome/common/extensions/docs/experimental.webRequest.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <div id="pageData-name" class="pageData">WebRequest API</div> 1 <div id="pageData-name" class="pageData">WebRequest API</div>
2 2
3 <!-- BEGIN AUTHORED CONTENT --> 3 <!-- BEGIN AUTHORED CONTENT -->
4 <p id="classSummary"> 4 <p id="classSummary">
5 Use the <code>chrome.experimental.webRequest</code> module to intercept, block, 5 Use the <code>chrome.experimental.webRequest</code> module to intercept, block,
6 or modify requests in-flight. This module is still very much experimental. For 6 or modify requests in-flight. This module is still very much experimental. For
7 information on how to use experimental APIs, see the 7 information on how to use experimental APIs, see the
8 <a href="experimental.html">chrome.experimental.* APIs</a> page. 8 <a href="experimental.html">chrome.experimental.* APIs</a> page.
9 </p> 9 </p>
10 10
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 {}, 224 {},
225 ["blocking"]); 225 ["blocking"]);
226 </pre> 226 </pre>
227 227
228 <p>The following example achives the same goal in a more efficient way because 228 <p>The following example achives the same goal in a more efficient way because
229 requests that are not targeted to <code>www.evil.com</code> do not need to be 229 requests that are not targeted to <code>www.evil.com</code> do not need to be
230 passed to the extension:</p> 230 passed to the extension:</p>
231 <pre> 231 <pre>
232 chrome.experimental.webRequest.onBeforeRequest.addListener( 232 chrome.experimental.webRequest.onBeforeRequest.addListener(
233 function(details) { return {cancel: true}; }, 233 function(details) { return {cancel: true}; },
234 {"*://www.evil.com/*"}, 234 {urls: ["*://www.evil.com/*"]},
235 ["blocking"]); 235 ["blocking"]);
236 </pre> 236 </pre>
237 237
238 <p>The following example illustrates how the User-Agent header can be deleted 238 <p>The following example illustrates how the User-Agent header can be deleted
239 from all requests:</p> 239 from all requests:</p>
240 <pre> 240 <pre>
241 chrome.experimental.webRequest.onBeforeSendHeaders.addListener( 241 chrome.experimental.webRequest.onBeforeSendHeaders.addListener(
242 function(details) { 242 function(details) {
243 delete details.requestHeaders['User-Agent']; 243 delete details.requestHeaders['User-Agent'];
244 return {requestHeaders: details.requestHeaders}; 244 return {requestHeaders: details.requestHeaders};
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 // Use the frameUrl e.g. to selectively cancel requests. 276 // Use the frameUrl e.g. to selectively cancel requests.
277 // Attention: The frameUrl can be undefined in some cases. Requests may not 277 // Attention: The frameUrl can be undefined in some cases. Requests may not
278 // originate from a frame (e.g. requests from extensions or shared workers). 278 // originate from a frame (e.g. requests from extensions or shared workers).
279 }); 279 });
280 280
281 chrome.windows.onRemoved.addListener( 281 chrome.windows.onRemoved.addListener(
282 function(windowId) {delete frameUrl[windowId];} 282 function(windowId) {delete frameUrl[windowId];}
283 ); 283 );
284 </pre> 284 </pre>
285 <!-- END AUTHORED CONTENT --> 285 <!-- END AUTHORED CONTENT -->
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/experimental.webRequest.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698