| 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> |
| 11 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | 11 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| 12 <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> | 12 <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> |
| 13 <link href="css/print.css" rel="stylesheet" type="text/css" media="print"> | 13 <link href="css/print.css" rel="stylesheet" type="text/css" media="print"> |
| 14 <script type="text/javascript" src="../../../third_party/jstemplate/jstempla
te_compiled.js"> | 14 <script type="text/javascript" src="../../../third_party/jstemplate/jstempla
te_compiled.js"> |
| 15 </script> | 15 </script> |
| 16 <script type="text/javascript" src="js/api_page_generator.js"></script> | 16 <script type="text/javascript" src="js/api_page_generator.js"></script> |
| 17 <script type="text/javascript" src="js/bootstrap.js"></script> | 17 <script type="text/javascript" src="js/bootstrap.js"></script> |
| 18 <script type="text/javascript" src="js/sidebar.js"></script> | 18 <script type="text/javascript" src="js/sidebar.js"></script> |
| 19 <meta name="description" content="Documentation for the chrome.experimental.pr
ivacy module, which is part of the Google Chrome extension APIs."><title>chrome
.experimental.privacy - Google Chrome Extensions - Google Code</title></head> | 19 <meta name="description" content="Documentation for the chrome.privacy module,
which is part of the Google Chrome extension APIs."><title>Privacy - Google Ch
rome Extensions - Google Code</title></head> |
| 20 <body> <div id="gc-container" class="labs"> | 20 <body> <div id="gc-container" class="labs"> |
| 21 <div id="devModeWarning"> | 21 <div id="devModeWarning"> |
| 22 You are viewing extension docs in chrome via the 'file:' scheme: are you
expecting to see local changes when you refresh? You'll need run chrome with --
allow-file-access-from-files. | 22 You are viewing extension docs in chrome via the 'file:' scheme: are you
expecting to see local changes when you refresh? You'll need run chrome with --
allow-file-access-from-files. |
| 23 </div> | 23 </div> |
| 24 <!-- SUBTEMPLATES: DO NOT MOVE FROM THIS LOCATION --> | 24 <!-- SUBTEMPLATES: DO NOT MOVE FROM THIS LOCATION --> |
| 25 <!-- In particular, sub-templates that recurse, must be used by allowing | 25 <!-- In particular, sub-templates that recurse, must be used by allowing |
| 26 jstemplate to make a copy of the template in this section which | 26 jstemplate to make a copy of the template in this section which |
| 27 are not operated on by way of the jsskip="true" --> | 27 are not operated on by way of the jsskip="true" --> |
| 28 <div style="display:none"> | 28 <div style="display:none"> |
| 29 | 29 |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 </ul> | 287 </ul> |
| 288 </li> | 288 </li> |
| 289 </ul> | 289 </ul> |
| 290 </div> | 290 </div> |
| 291 <script> | 291 <script> |
| 292 initToggles(); | 292 initToggles(); |
| 293 </script> | 293 </script> |
| 294 | 294 |
| 295 <div class="g-unit" id="gc-pagecontent"> | 295 <div class="g-unit" id="gc-pagecontent"> |
| 296 <div id="pageTitle"> | 296 <div id="pageTitle"> |
| 297 <h1 class="page_title">chrome.experimental.privacy</h1> | 297 <h1 class="page_title">Privacy</h1> |
| 298 </div> | 298 </div> |
| 299 <!-- TABLE OF CONTENTS --> | 299 <!-- TABLE OF CONTENTS --> |
| 300 <div id="toc"> | 300 <div id="toc"> |
| 301 <h2>Contents</h2> | 301 <h2>Contents</h2> |
| 302 <ol> | 302 <ol> |
| 303 <li style="display: none; "> | 303 <li> |
| 304 <a>h2Name</a> | 304 <a href="#manifest">Manifest</a> |
| 305 <ol> | 305 <ol> |
| 306 <li> | 306 <li style="display: none; "> |
| 307 <a>h3Name</a> |
| 308 </li> |
| 309 </ol> |
| 310 </li><li> |
| 311 <a href="#usage">Usage</a> |
| 312 <ol> |
| 313 <li style="display: none; "> |
| 314 <a>h3Name</a> |
| 315 </li> |
| 316 </ol> |
| 317 </li><li> |
| 318 <a href="#examples">Examples</a> |
| 319 <ol> |
| 320 <li style="display: none; "> |
| 307 <a>h3Name</a> | 321 <a>h3Name</a> |
| 308 </li> | 322 </li> |
| 309 </ol> | 323 </ol> |
| 310 </li> | 324 </li> |
| 311 <li> | 325 <li> |
| 312 <a href="#apiReference">API reference: chrome.experimental.priva
cy</a> | 326 <a href="#apiReference">API reference: chrome.privacy</a> |
| 313 <ol> | 327 <ol> |
| 314 <li> | 328 <li> |
| 315 <a href="#properties">Properties</a> | 329 <a href="#properties">Properties</a> |
| 316 <ol> | 330 <ol> |
| 317 <li> | 331 <li> |
| 318 <a href="#property-network">network</a> | 332 <a href="#property-network">network</a> |
| 319 </li><li> | 333 </li><li> |
| 320 <a href="#property-services">services</a> | 334 <a href="#property-services">services</a> |
| 321 </li><li> | 335 </li><li> |
| 322 <a href="#property-websites">websites</a> | 336 <a href="#property-websites">websites</a> |
| (...skipping 28 matching lines...) Expand all Loading... |
| 351 </li> | 365 </li> |
| 352 </ol> | 366 </ol> |
| 353 </li> | 367 </li> |
| 354 </ol> | 368 </ol> |
| 355 </li> | 369 </li> |
| 356 </ol> | 370 </ol> |
| 357 </div> | 371 </div> |
| 358 <!-- /TABLE OF CONTENTS --> | 372 <!-- /TABLE OF CONTENTS --> |
| 359 | 373 |
| 360 <!-- Standard content lead-in for experimental API pages --> | 374 <!-- Standard content lead-in for experimental API pages --> |
| 361 <p id="classSummary"> | 375 <p id="classSummary" style="display: none; "> |
| 362 For information on how to use experimental APIs, see the <a href="expe
rimental.html">chrome.experimental.* APIs</a> page. | 376 For information on how to use experimental APIs, see the <a href="expe
rimental.html">chrome.experimental.* APIs</a> page. |
| 363 </p> | 377 </p> |
| 364 | 378 |
| 365 <!-- STATIC CONTENT PLACEHOLDER --> | 379 <!-- STATIC CONTENT PLACEHOLDER --> |
| 366 <div id="static"></div> | 380 <div id="static"><div id="pageData-name" class="pageData">Privacy</div> |
| 381 |
| 382 <!-- BEGIN AUTHORED CONTENT --> |
| 383 <p id="classSummary"> |
| 384 Use the <code>chrome.privacy</code> module to control usage of the features in |
| 385 Chrome that can affect a user's privacy. This module relies on the |
| 386 <a href="types.html#ChromeSetting">ChromeSetting prototype of the type API</a> |
| 387 for getting and setting Chrome's configuration. |
| 388 </p> |
| 389 |
| 390 <p class="note"> |
| 391 The <a href="http://www.google.com/intl/en/landing/chrome/google-chrome-privac
y-whitepaper.pdf">Chrome Privacy Whitepaper</a> |
| 392 gives background detail regarding the features which this API can control. |
| 393 </p> |
| 394 |
| 395 <h2 id="manifest">Manifest</h2> |
| 396 <p> |
| 397 You must declare the "privacy" permission in your extension's |
| 398 <a href="manifest.html"> manifest</a> to use the API. For example: |
| 399 </p> |
| 400 |
| 401 <pre>{ |
| 402 "name": "My extension", |
| 403 ... |
| 404 <b>"permissions": [ |
| 405 "privacy" |
| 406 ]</b>, |
| 407 ... |
| 408 }</pre> |
| 409 |
| 410 <h2 id="usage">Usage</h2> |
| 411 |
| 412 <p> |
| 413 Reading the current value of a Chrome setting is straightforward. You'll first |
| 414 need to find the property you're interested in, then you'll call |
| 415 <code>get()</code> on that object in order to retrieve it's current value and |
| 416 your extension's level of control. For example, to determine if Chrome's |
| 417 Autofill feature is enabled, you'd write: |
| 418 </p> |
| 419 |
| 420 <pre>chrome.privacy.services.autofillEnabled.get({}, function(details) { |
| 421 if (details.value) |
| 422 console.log('Autofill is on!'); |
| 423 else |
| 424 console.log('Autofill is off!'); |
| 425 });</pre> |
| 426 |
| 427 <p> |
| 428 Changing the value of a setting is a little bit more complex, simply because |
| 429 you first must verify that your extension can control the setting. Chrome will |
| 430 deny access to a setting if the setting is either locked to a specific value |
| 431 by enterprise policies (<code>levelOfControl</code> will be set to |
| 432 "not_controllable"), or if another extension is controlling the value |
| 433 (<code>levelOfControl</code> will be set to "controlled_by_other_extensions"). |
| 434 </p> |
| 435 |
| 436 <p class="note"> |
| 437 Full details about extension's ability to control <code>ChromeSetting</code>s |
| 438 can be found under |
| 439 <a href="types.html#ChromeSetting"> |
| 440 <code>chrome.types.ChromeSetting</code></a>. |
| 441 </p> |
| 442 |
| 443 <p> |
| 444 This means that you'll need to use the <code>get()</code> method to determine |
| 445 your level of access, and then only call <code>set()</code> if your extension |
| 446 can grab control over the setting: |
| 447 </p> |
| 448 |
| 449 <pre>chrome.privacy.services.autofillEnabled.get({}, function(details) { |
| 450 if (details.levelOfControl === 'controllable_by_this_extension') { |
| 451 chrome.privacy.services.autofillEnabled.set({ value: true }, function() { |
| 452 if (chrome.extension.lastError === undefined) |
| 453 console.log("Hooray, it worked!"); |
| 454 else |
| 455 console.log("Sadness!", chrome.extension.lastError); |
| 456 } |
| 457 } |
| 458 });</pre> |
| 459 |
| 460 <p> |
| 461 If you're interested in changes to a setting's value, add a listener to its |
| 462 <code>onChange</code> event. Among other uses, this will allow you to warn the |
| 463 user if a more recently installed extension grabs control of a setting, or if |
| 464 enterprise policy overrides your control. To listen for changes to Autofill's |
| 465 status, for example, the following code would suffice: |
| 466 </p> |
| 467 |
| 468 <pre>chrome.privacy.services.autofillEnabled.onChange.addListener( |
| 469 function (details) { |
| 470 // The new value is stored in `details.value`, the new level of control |
| 471 // in `details.levelOfControl`, and `details.incognitoSpecific` will be |
| 472 // `true` if the value is specific to Incognito mode. |
| 473 });</pre> |
| 474 |
| 475 <h2 id="examples">Examples</h2> |
| 476 <p> |
| 477 For example code, see the |
| 478 <a href="samples.html#privacy">Privacy API samples</a>. |
| 479 </p> |
| 480 <!-- END AUTHORED CONTENT --> |
| 481 </div> |
| 367 | 482 |
| 368 <!-- API PAGE --> | 483 <!-- API PAGE --> |
| 369 <div class="apiPage"> | 484 <div class="apiPage"> |
| 370 <a name="apiReference"></a> | 485 <a name="apiReference"></a> |
| 371 <h2>API reference: chrome.experimental.privacy</h2> | 486 <h2>API reference: chrome.privacy</h2> |
| 372 | 487 |
| 373 <!-- PROPERTIES --> | 488 <!-- PROPERTIES --> |
| 374 <div class="apiGroup"> | 489 <div class="apiGroup"> |
| 375 <a name="properties"></a> | 490 <a name="properties"></a> |
| 376 <h3 id="properties">Properties</h3> | 491 <h3 id="properties">Properties</h3> |
| 377 | 492 |
| 378 <div> | 493 <div> |
| 379 <a name="property-network"></a> | 494 <a name="property-network"></a> |
| 380 <h4>network</h4> | 495 <h4>network</h4> |
| 381 <div class="summary"> | 496 <div class="summary"> |
| 382 <!-- Note: intentionally longer 80 columns --> | 497 <!-- Note: intentionally longer 80 columns --> |
| 383 <span>chrome.experimental.privacy.</span><span>network</span> | 498 <span>chrome.privacy.</span><span>network</span> |
| 384 </div> | 499 </div> |
| 385 <div> | 500 <div> |
| 386 <dt> | 501 <dt> |
| 387 <var>network</var> | 502 <var>network</var> |
| 388 <em> | 503 <em> |
| 389 | 504 |
| 390 <!-- TYPE --> | 505 <!-- TYPE --> |
| 391 <div style="display:inline"> | 506 <div style="display:inline"> |
| 392 ( | 507 ( |
| 393 <span class="optional" style="display: none; ">optional</spa
n> | 508 <span class="optional" style="display: none; ">optional</spa
n> |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 <dd style="display: none; "> | 627 <dd style="display: none; "> |
| 513 <div></div> | 628 <div></div> |
| 514 </dd> | 629 </dd> |
| 515 | 630 |
| 516 </div> | 631 </div> |
| 517 </div><div> | 632 </div><div> |
| 518 <a name="property-services"></a> | 633 <a name="property-services"></a> |
| 519 <h4>services</h4> | 634 <h4>services</h4> |
| 520 <div class="summary"> | 635 <div class="summary"> |
| 521 <!-- Note: intentionally longer 80 columns --> | 636 <!-- Note: intentionally longer 80 columns --> |
| 522 <span>chrome.experimental.privacy.</span><span>services</span> | 637 <span>chrome.privacy.</span><span>services</span> |
| 523 </div> | 638 </div> |
| 524 <div> | 639 <div> |
| 525 <dt> | 640 <dt> |
| 526 <var>services</var> | 641 <var>services</var> |
| 527 <em> | 642 <em> |
| 528 | 643 |
| 529 <!-- TYPE --> | 644 <!-- TYPE --> |
| 530 <div style="display:inline"> | 645 <div style="display:inline"> |
| 531 ( | 646 ( |
| 532 <span class="optional" style="display: none; ">optional</spa
n> | 647 <span class="optional" style="display: none; ">optional</spa
n> |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 | 880 |
| 766 <!-- FUNCTION PARAMETERS --> | 881 <!-- FUNCTION PARAMETERS --> |
| 767 <dd style="display: none; "> | 882 <dd style="display: none; "> |
| 768 <div></div> | 883 <div></div> |
| 769 </dd> | 884 </dd> |
| 770 | 885 |
| 771 </div> | 886 </div> |
| 772 </div><div> | 887 </div><div> |
| 773 <div> | 888 <div> |
| 774 <dt> | 889 <dt> |
| 775 <var>metricsReportingEnabled</var> | |
| 776 <em> | |
| 777 | |
| 778 <!-- TYPE --> | |
| 779 <div style="display:inline"> | |
| 780 ( | |
| 781 <span class="optional" style="display: none; ">optional</spa
n> | |
| 782 <span class="enum" style="display: none; ">enumerated</span> | |
| 783 <span id="typeTemplate"> | |
| 784 <span> | |
| 785 <a href="types.html#type-ChromeSetting">ChromeSetting</a
> | |
| 786 </span> | |
| 787 <span style="display: none; "> | |
| 788 <span> | |
| 789 array of <span><span></span></span> | |
| 790 </span> | |
| 791 <span>paramType</span> | |
| 792 <span></span> | |
| 793 </span> | |
| 794 </span> | |
| 795 ) | |
| 796 </div> | |
| 797 | |
| 798 </em> | |
| 799 </dt> | |
| 800 <dd class="todo" style="display: none; "> | |
| 801 Undocumented. | |
| 802 </dd> | |
| 803 <dd>If enabled, Chrome automatically sends usage statistics and crash
reports to Google. This preference's value is a boolean, defaulting to <code>fal
se</code>.</dd> | |
| 804 <dd style="display: none; "> | |
| 805 This parameter was added in version | |
| 806 <b><span></span></b>. | |
| 807 You must omit this parameter in earlier versions, | |
| 808 and you may omit it in any version. If you require this | |
| 809 parameter, the manifest key | |
| 810 <a href="manifest.html#minimum_chrome_version">minimum_chrome_versio
n</a> | |
| 811 can ensure that your extension won't be run in an earlier browser ve
rsion. | |
| 812 </dd> | |
| 813 | |
| 814 <!-- OBJECT PROPERTIES --> | |
| 815 <dd style="display: none; "> | |
| 816 <dl> | |
| 817 <div> | |
| 818 <div> | |
| 819 </div> | |
| 820 </div> | |
| 821 </dl> | |
| 822 </dd> | |
| 823 | |
| 824 <!-- OBJECT METHODS --> | |
| 825 <dd style="display: none; "> | |
| 826 <div></div> | |
| 827 </dd> | |
| 828 | |
| 829 <!-- OBJECT EVENT FIELDS --> | |
| 830 <dd style="display: none; "> | |
| 831 <div></div> | |
| 832 </dd> | |
| 833 | |
| 834 <!-- FUNCTION PARAMETERS --> | |
| 835 <dd style="display: none; "> | |
| 836 <div></div> | |
| 837 </dd> | |
| 838 | |
| 839 </div> | |
| 840 </div><div> | |
| 841 <div> | |
| 842 <dt> | |
| 843 <var>safeBrowsingEnabled</var> | 890 <var>safeBrowsingEnabled</var> |
| 844 <em> | 891 <em> |
| 845 | 892 |
| 846 <!-- TYPE --> | 893 <!-- TYPE --> |
| 847 <div style="display:inline"> | 894 <div style="display:inline"> |
| 848 ( | 895 ( |
| 849 <span class="optional" style="display: none; ">optional</spa
n> | 896 <span class="optional" style="display: none; ">optional</spa
n> |
| 850 <span class="enum" style="display: none; ">enumerated</span> | 897 <span class="enum" style="display: none; ">enumerated</span> |
| 851 <span id="typeTemplate"> | 898 <span id="typeTemplate"> |
| 852 <span> | 899 <span> |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1059 <dd style="display: none; "> | 1106 <dd style="display: none; "> |
| 1060 <div></div> | 1107 <div></div> |
| 1061 </dd> | 1108 </dd> |
| 1062 | 1109 |
| 1063 </div> | 1110 </div> |
| 1064 </div><div> | 1111 </div><div> |
| 1065 <a name="property-websites"></a> | 1112 <a name="property-websites"></a> |
| 1066 <h4>websites</h4> | 1113 <h4>websites</h4> |
| 1067 <div class="summary"> | 1114 <div class="summary"> |
| 1068 <!-- Note: intentionally longer 80 columns --> | 1115 <!-- Note: intentionally longer 80 columns --> |
| 1069 <span>chrome.experimental.privacy.</span><span>websites</span> | 1116 <span>chrome.privacy.</span><span>websites</span> |
| 1070 </div> | 1117 </div> |
| 1071 <div> | 1118 <div> |
| 1072 <dt> | 1119 <dt> |
| 1073 <var>websites</var> | 1120 <var>websites</var> |
| 1074 <em> | 1121 <em> |
| 1075 | 1122 |
| 1076 <!-- TYPE --> | 1123 <!-- TYPE --> |
| 1077 <div style="display:inline"> | 1124 <div style="display:inline"> |
| 1078 ( | 1125 ( |
| 1079 <span class="optional" style="display: none; ">optional</spa
n> | 1126 <span class="optional" style="display: none; ">optional</spa
n> |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1523 _uff=0; | 1570 _uff=0; |
| 1524 urchinTracker(); | 1571 urchinTracker(); |
| 1525 } | 1572 } |
| 1526 catch(e) {/* urchinTracker not available. */} | 1573 catch(e) {/* urchinTracker not available. */} |
| 1527 </script> | 1574 </script> |
| 1528 <!-- end analytics --> | 1575 <!-- end analytics --> |
| 1529 </div> | 1576 </div> |
| 1530 </div> <!-- /gc-footer --> | 1577 </div> <!-- /gc-footer --> |
| 1531 </div> <!-- /gc-container --> | 1578 </div> <!-- /gc-container --> |
| 1532 </body></html> | 1579 </body></html> |
| OLD | NEW |