OLD | NEW |
1 <p class="note"> | 1 <p class="note"> |
2 The <a href="http://www.google.com/intl/en/landing/chrome/google-chrome-privac
y-whitepaper.pdf">Chrome Privacy Whitepaper</a> | 2 The <a href="http://www.google.com/intl/en/landing/chrome/google-chrome-privac
y-whitepaper.pdf">Chrome Privacy Whitepaper</a> |
3 gives background detail regarding the features which this API can control. | 3 gives background detail regarding the features which this API can control. |
4 </p> | 4 </p> |
5 | 5 |
6 <h2 id="manifest">Manifest</h2> | 6 <h2 id="manifest">Manifest</h2> |
7 <p> | 7 <p> |
8 You must declare the "privacy" permission in your extension's | 8 You must declare the "privacy" permission in your extension's |
9 <a href="manifest.html">manifest</a> to use the API. For example: | 9 <a href="manifest">manifest</a> to use the API. For example: |
10 </p> | 10 </p> |
11 | 11 |
12 <pre data-filename="manifest.json"> | 12 <pre data-filename="manifest.json"> |
13 { | 13 { |
14 "name": "My extension", | 14 "name": "My extension", |
15 ... | 15 ... |
16 <b>"permissions": [ | 16 <b>"permissions": [ |
17 "privacy" | 17 "privacy" |
18 ]</b>, | 18 ]</b>, |
19 ... | 19 ... |
(...skipping 26 matching lines...) Expand all Loading... |
46 extension is controlling the value (<code>levelOfControl</code> will be set to | 46 extension is controlling the value (<code>levelOfControl</code> will be set to |
47 "controlled_by_other_extensions"). The <code>set()</code> call will succeed, | 47 "controlled_by_other_extensions"). The <code>set()</code> call will succeed, |
48 but the setting will be immediately overridden. As this might be confusing, it | 48 but the setting will be immediately overridden. As this might be confusing, it |
49 is advisable to warn the user when the settings they've chosen aren't | 49 is advisable to warn the user when the settings they've chosen aren't |
50 practically applied. | 50 practically applied. |
51 </p> | 51 </p> |
52 | 52 |
53 <p class="note"> | 53 <p class="note"> |
54 Full details about extensions' ability to control <code>ChromeSetting</code>s | 54 Full details about extensions' ability to control <code>ChromeSetting</code>s |
55 can be found under | 55 can be found under |
56 <a href="types.html#ChromeSetting"> | 56 <a href="types#ChromeSetting"> |
57 <code>chrome.types.ChromeSetting</code></a>. | 57 <code>chrome.types.ChromeSetting</code></a>. |
58 </p> | 58 </p> |
59 | 59 |
60 <p> | 60 <p> |
61 This means that you ought to use the <code>get()</code> method to determine | 61 This means that you ought to use the <code>get()</code> method to determine |
62 your level of access, and then only call <code>set()</code> if your extension | 62 your level of access, and then only call <code>set()</code> if your extension |
63 can grab control over the setting (in fact if your extension can't control the | 63 can grab control over the setting (in fact if your extension can't control the |
64 setting it's probably a good idea to visually disable the functionality to | 64 setting it's probably a good idea to visually disable the functionality to |
65 reduce user confusion): | 65 reduce user confusion): |
66 </p> | 66 </p> |
(...skipping 20 matching lines...) Expand all Loading... |
87 <pre>chrome.privacy.services.autofillEnabled.onChange.addListener( | 87 <pre>chrome.privacy.services.autofillEnabled.onChange.addListener( |
88 function (details) { | 88 function (details) { |
89 // The new value is stored in `details.value`, the new level of control | 89 // The new value is stored in `details.value`, the new level of control |
90 // in `details.levelOfControl`, and `details.incognitoSpecific` will be | 90 // in `details.levelOfControl`, and `details.incognitoSpecific` will be |
91 // `true` if the value is specific to Incognito mode. | 91 // `true` if the value is specific to Incognito mode. |
92 });</pre> | 92 });</pre> |
93 | 93 |
94 <h2 id="examples">Examples</h2> | 94 <h2 id="examples">Examples</h2> |
95 <p> | 95 <p> |
96 For example code, see the | 96 For example code, see the |
97 <a href="samples.html#privacy">Privacy API samples</a>. | 97 <a href="samples#privacy">Privacy API samples</a>. |
98 </p> | 98 </p> |
99 | 99 |
OLD | NEW |