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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 <a href="#proxy_modes">Proxy modes</a> | 271 <a href="#proxy_modes">Proxy modes</a> |
272 </li><li> | 272 </li><li> |
273 <a href="#proxy_rules">Proxy rules</a> | 273 <a href="#proxy_rules">Proxy rules</a> |
274 </li><li> | 274 </li><li> |
275 <a href="#proxy_server_objects">Proxy server objects</a> | 275 <a href="#proxy_server_objects">Proxy server objects</a> |
276 </li><li> | 276 </li><li> |
277 <a href="#bypass_list">Bypass list</a> | 277 <a href="#bypass_list">Bypass list</a> |
278 </li> | 278 </li> |
279 </ol> | 279 </ol> |
280 </li><li> | 280 </li><li> |
281 <a href="#precedence">Precedence</a> | |
282 <ol> | |
283 <li style="display: none; "> | |
284 <a>h3Name</a> | |
285 </li> | |
286 </ol> | |
287 </li><li> | |
288 <a href="#overview-examples">Examples</a> | 281 <a href="#overview-examples">Examples</a> |
289 <ol> | 282 <ol> |
290 <li style="display: none; "> | 283 <li style="display: none; "> |
291 <a>h3Name</a> | 284 <a>h3Name</a> |
292 </li> | 285 </li> |
293 </ol> | 286 </ol> |
294 </li> | 287 </li> |
295 <li> | 288 <li> |
296 <a href="#apiReference">API reference: chrome.proxy</a> | 289 <a href="#apiReference">API reference: chrome.proxy</a> |
297 <ol> | 290 <ol> |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 <p id="classSummary" style="display: none; "> | 336 <p id="classSummary" style="display: none; "> |
344 For information on how to use experimental APIs, see the <a href="expe
rimental.html">chrome.experimental.* APIs</a> page. | 337 For information on how to use experimental APIs, see the <a href="expe
rimental.html">chrome.experimental.* APIs</a> page. |
345 </p> | 338 </p> |
346 | 339 |
347 <!-- STATIC CONTENT PLACEHOLDER --> | 340 <!-- STATIC CONTENT PLACEHOLDER --> |
348 <div id="static"><div id="pageData-name" class="pageData">Proxy Settings
</div> | 341 <div id="static"><div id="pageData-name" class="pageData">Proxy Settings
</div> |
349 | 342 |
350 <!-- BEGIN AUTHORED CONTENT --> | 343 <!-- BEGIN AUTHORED CONTENT --> |
351 <p id="classSummary"> | 344 <p id="classSummary"> |
352 Use the <code>chrome.proxy</code> module to manage Chrome's | 345 Use the <code>chrome.proxy</code> module to manage Chrome's |
353 proxy settings. | 346 proxy settings. This module relies on the <a href="preferences.html">preferences |
| 347 API</a> for getting and setting the proxy configuration. |
354 </p> | 348 </p> |
355 | 349 |
356 <h2 id="manifest">Manifest</h2> | 350 <h2 id="manifest">Manifest</h2> |
357 <p>You must declare the "proxy" permission | 351 <p>You must declare the "proxy" permission |
358 in the <a href="manifest.html">extension manifest</a> | 352 in the <a href="manifest.html">extension manifest</a> |
359 to use the proxy settings API. | 353 to use the proxy settings API. |
360 For example:</p> | 354 For example:</p> |
361 <pre>{ | 355 <pre>{ |
362 "name": "My extension", | 356 "name": "My extension", |
363 ... | 357 ... |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 range is specified using CIDR notation.<br> | 482 range is specified using CIDR notation.<br> |
489 Examples: <code>"192.168.1.1/16", "fefe:13::abc/33"</code></dd> | 483 Examples: <code>"192.168.1.1/16", "fefe:13::abc/33"</code></dd> |
490 | 484 |
491 <dt><code><local></code></dt> | 485 <dt><code><local></code></dt> |
492 <dd>Match local addresses. An address is local if the host is "127.0.0.1", | 486 <dd>Match local addresses. An address is local if the host is "127.0.0.1", |
493 "::1", or "localhost".<br> | 487 "::1", or "localhost".<br> |
494 Example: <code>"<local>"</code></dd> | 488 Example: <code>"<local>"</code></dd> |
495 </dl> | 489 </dl> |
496 | 490 |
497 | 491 |
498 <h2 id="precedence">Precedence</h2> | |
499 | |
500 <p> | |
501 Chrome manages settings on different layers. The following list describes the | |
502 layers that may influence the effective proxy settings, in increasing order of | |
503 precedence. | |
504 </p><ol> | |
505 <li>System settings provided by the operating system</li> | |
506 <li>Command line parameters</li> | |
507 <li>Preferences set by extensions</li> | |
508 <li>Policies</li> | |
509 </ol> | |
510 <p></p> | |
511 | |
512 <p> | |
513 As the list implies, policies might overrule any changes that you specify with | |
514 the proxy settings API. | |
515 </p> | |
516 | |
517 <!-- | |
518 <p> | |
519 Chrome allows using different proxy settings for regular windows and incognito | |
520 windows. The following example illustrates the behavior. Assume that no policy | |
521 overrides the proxy settings and that an extension can set proxy settings for | |
522 regular windows <b>(R)</b> and proxy settings for incognito windows <b>(I)</b>. | |
523 </p> | |
524 | |
525 <p> | |
526 <ul> | |
527 <li>If only <b>(R)</b> is set, these settings are effective for both regular | |
528 and incognito windows.</li> | |
529 <li>If only <b>(I)</b> is set, these settings are effective for only incognito | |
530 windows. Regular windows use the proxy settings determined by the lower layers | |
531 (command-line options and system settings).</li> | |
532 <li>If both <b>(R)</b> and <b>(I)</b> are set, the respective settings are | |
533 used for regular and incognito windows.</li> | |
534 </ul> | |
535 </p> | |
536 | |
537 <p> | |
538 If two extensions want to set proxy settings, the extension installed last takes | |
539 precedence over the other extensions. If the extension installed last sets only | |
540 <b>(I)</b>, the settings of regular windows can be defined by more recently | |
541 installed extensions. | |
542 </p> | |
543 --> | |
544 | |
545 | |
546 | |
547 <h2 id="overview-examples">Examples</h2> | 492 <h2 id="overview-examples">Examples</h2> |
548 | 493 |
549 <p> | 494 <p> |
550 The following code sets a SOCKS 5 proxy for HTTP connections to all servers but | 495 The following code sets a SOCKS 5 proxy for HTTP connections to all servers but |
551 foobar.com and uses direct connections for all other protocols. The settings | 496 foobar.com and uses direct connections for all other protocols. The settings |
552 apply to regular and incognito windows. | 497 apply to regular and incognito windows, as incognito windows inherit preferences |
| 498 from regular windows. Please also consult the <a href="preferences.html">Prefere
nces API</a> documentation. |
553 </p> | 499 </p> |
554 | 500 |
555 <pre>var config = { | 501 <pre>var config = { |
556 mode: "fixed_servers", | 502 mode: "fixed_servers", |
557 rules: { | 503 rules: { |
558 httpProxy: { | 504 httpProxy: { |
559 scheme: "socks5", | 505 scheme: "socks5", |
560 host: "1.2.3.4" | 506 host: "1.2.3.4" |
561 }, | 507 }, |
562 bypassList: ["foobar.com"] | 508 bypassList: ["foobar.com"] |
563 } | 509 } |
564 }; | 510 }; |
565 chrome.proxy.settings.set( | 511 chrome.proxy.settings.set( |
566 {value: config, scope: 'regular'}, | 512 {value: config, scope: 'regular'}, |
567 function() {}); | 513 function() {}); |
568 </pre> | 514 </pre> |
569 | 515 |
570 <p> | 516 <p> |
571 The following code sets a custom pac script. | 517 The following code sets a custom PAC script. |
572 </p> | 518 </p> |
573 | 519 |
574 <pre>var config = { | 520 <pre>var config = { |
575 mode: "pac_script", | 521 mode: "pac_script", |
576 pacScript: { | 522 pacScript: { |
577 data: "function FindProxyForURL(url, host) {\n" + | 523 data: "function FindProxyForURL(url, host) {\n" + |
578 " if (host == 'foobar.com')\n" + | 524 " if (host == 'foobar.com')\n" + |
579 " return 'PROXY blackhole:80';\n" + | 525 " return 'PROXY blackhole:80';\n" + |
580 " return 'DIRECT';\n" + | 526 " return 'DIRECT';\n" + |
581 "}" | 527 "}" |
582 } | 528 } |
583 }; | 529 }; |
584 chrome.proxy.settings.set( | 530 chrome.proxy.settings.set( |
585 {value: config, scope: 'regular'}, | 531 {value: config, scope: 'regular'}, |
586 function() {}); | 532 function() {}); |
587 </pre> | 533 </pre> |
588 | 534 |
589 <p> | 535 <p> |
590 The next snippet queries the current proxy settings. | 536 The next snippet queries the currently effective proxy settings. The effective |
| 537 proxy settings can be determined by another extension or by a policy. See the <a
href="preferences.html">Preferences API</a> documentation for details. |
591 </p> | 538 </p> |
592 | 539 |
593 <pre>chrome.proxy.settings.getEffective( | 540 <pre>chrome.proxy.settings.getEffective( |
594 {'incognito': false}, | 541 {'incognito': false}, |
595 function(config) {console.log(JSON.stringify(config));}); | 542 function(config) {console.log(JSON.stringify(config));}); |
596 </pre> | 543 </pre> |
597 | 544 |
598 <p> | 545 <p> |
599 Note that the <code>value</code> object passed to <code>set()</code> is not | 546 Note that the <code>value</code> object passed to <code>set()</code> is not |
600 identical to the <code>value</code> object passed to callback function of | 547 identical to the <code>value</code> object passed to callback function of |
(...skipping 1841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2442 _uff=0; | 2389 _uff=0; |
2443 urchinTracker(); | 2390 urchinTracker(); |
2444 } | 2391 } |
2445 catch(e) {/* urchinTracker not available. */} | 2392 catch(e) {/* urchinTracker not available. */} |
2446 </script> | 2393 </script> |
2447 <!-- end analytics --> | 2394 <!-- end analytics --> |
2448 </div> | 2395 </div> |
2449 </div> <!-- /gc-footer --> | 2396 </div> <!-- /gc-footer --> |
2450 </div> <!-- /gc-container --> | 2397 </div> <!-- /gc-container --> |
2451 </body></html> | 2398 </body></html> |
OLD | NEW |