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

Side by Side Diff: chrome/common/extensions/docs/templates/intros/webRequest.html

Issue 2714023002: Extension Docs: Document asyncBlocking in the Web Request API Docs. (Closed)
Patch Set: Address review Created 3 years, 9 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
« no previous file with comments | « no previous file | extensions/common/api/web_request.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <h2 id="manifest">Manifest</h2> 1 <h2 id="manifest">Manifest</h2>
2 <p>You must declare the "webRequest" permission in the <a 2 <p>You must declare the "webRequest" permission in the <a
3 href="manifest">extension manifest</a> to use the web request 3 href="manifest">extension manifest</a> to use the web request
4 API, along with <a href="declare_permissions">host permissions</a> 4 API, along with <a href="declare_permissions">host permissions</a>
5 for any hosts whose network requests you want to access. If you want to 5 for any hosts whose network requests you want to access. If you want to
6 use the web request API in a blocking fashion, you need to request 6 use the web request API in a blocking fashion, you need to request
7 the "webRequestBlocking" permission in addition. 7 the "webRequestBlocking" permission in addition.
8 For example:</p> 8 For example:</p>
9 <pre data-filename="manifest.json"> 9 <pre data-filename="manifest.json">
10 { 10 {
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 <code>'blocking'</code> (only allowed for specific events), the callback 203 <code>'blocking'</code> (only allowed for specific events), the callback
204 function is handled synchronously. That means that the request is blocked until 204 function is handled synchronously. That means that the request is blocked until
205 the callback function returns. In this case, the callback can return a 205 the callback function returns. In this case, the callback can return a
206 $(ref:webRequest.BlockingResponse) that determines the further 206 $(ref:webRequest.BlockingResponse) that determines the further
207 life cycle of the request. Depending on the context, this response allows 207 life cycle of the request. Depending on the context, this response allows
208 cancelling or redirecting a request (<code>onBeforeRequest</code>), cancelling a 208 cancelling or redirecting a request (<code>onBeforeRequest</code>), cancelling a
209 request or modifying headers (<code>onBeforeSendHeaders</code>, 209 request or modifying headers (<code>onBeforeSendHeaders</code>,
210 <code>onHeadersReceived</code>), or providing authentication credentials 210 <code>onHeadersReceived</code>), or providing authentication credentials
211 (<code>onAuthRequired</code>).</p> 211 (<code>onAuthRequired</code>).</p>
212 212
213 <p>If the optional <code>opt_extraInfoSpec</code> array contains the string
214 <code>'asyncBlocking'</code> instead (only allowed for
215 <code>onAuthRequired</code>), the extension can generate the
216 $(ref:webRequest.BlockingResponse) asynchronously.
217
213 <p>The $(ref:webRequest.RequestFilter) 218 <p>The $(ref:webRequest.RequestFilter)
214 <code>filter</code> allows limiting the requests for which events are 219 <code>filter</code> allows limiting the requests for which events are
215 triggered in various dimensions: 220 triggered in various dimensions:
216 <dl> 221 <dl>
217 <dt>URLs</dt> 222 <dt>URLs</dt>
218 <dd><a href="match_patterns">URL patterns</a> such as 223 <dd><a href="match_patterns">URL patterns</a> such as
219 <code>*://www.google.com/foo*bar</code>.</dd> 224 <code>*://www.google.com/foo*bar</code>.</dd>
220 <dt>Types</dt> 225 <dt>Types</dt>
221 <dd>Request types such as <code>main_frame</code> (a document that is loaded 226 <dd>Request types such as <code>main_frame</code> (a document that is loaded
222 for a top-level frame), <code>sub_frame</code> (a document that is loaded for 227 for a top-level frame), <code>sub_frame</code> (a document that is loaded for
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 } 324 }
320 } 325 }
321 return {requestHeaders: details.requestHeaders}; 326 return {requestHeaders: details.requestHeaders};
322 }, 327 },
323 {urls: ["&lt;all_urls&gt;"]}, 328 {urls: ["&lt;all_urls&gt;"]},
324 ["blocking", "requestHeaders"]); 329 ["blocking", "requestHeaders"]);
325 </pre> 330 </pre>
326 331
327 <p> For more example code, see the <a href="samples#search:webrequest">web reque st 332 <p> For more example code, see the <a href="samples#search:webrequest">web reque st
328 samples</a>.</p> 333 samples</a>.</p>
OLDNEW
« no previous file with comments | « no previous file | extensions/common/api/web_request.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698