Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / common / extensions / docs / templates / articles / permission_warnings.html
blob2001e843e5fbe9ca225817696d1177320773d5bc
1 <h1>Permission Warnings</h1>
4 <!--
5 NOTE: When this doc is updated, the online help should also be updated:
6 http://www.google.com/support/chrome_webstore/bin/answer.py?hl=en&answer=186213
8 We should periodically look at
9 http://src.chromium.org/viewvc/chrome/trunk/src/chrome/app/generated_resources.grd?view=markup
10 to make sure that we're covering all messages. Search for
11 IDS_EXTENSION_PROMPT_WARNING
12 (e.g. IDS_EXTENSION_PROMPT_WARNING_BROWSING_HISTORY).
13 -->
15 <p>
16 To use most chrome.* APIs and extension capabilities,
17 your extension must declare its intent in the
18 <a href="manifest.html">manifest</a>,
19 often in the "permissions" field.
20 Some of these declarations
21 result in a warning when
22 a user installs your extension.
23 </p>
25 <p>
26 When you autoupdate your extension,
27 the user might see another warning
28 if the extension requests new permissions.
29 These new permissions might be new APIs that your extension uses,
30 or they might be new websites
31 that your extension needs access to.
32 </p>
35 <h2 id="examples"> Examples of permission warnings </h2>
37 <p>
38 Here's a typical dialog
39 that a user might see when installing an extension:
40 </p>
42 <img src="{{static}}/images/perms-hw1.png"
43 width="490" height="193"
44 alt="Permission warning: 'It can: Access your data on api.flickr.com'"
47 <p>
48 The warning about access to data on api.flickr.com
49 is caused by the following lines
50 in the extension's manifest:
51 </p>
53 <pre data-filename="manifest.json">
54 "permissions": [
55 <b>"http://api.flickr.com/"</b>
57 </pre>
59 <p class="note">
60 <b>Note:</b>
61 You don't see permission warnings when
62 you load an unpacked extension.
63 You get permission warnings only when you install an extension
64 from a <code>.crx</code> file.
65 </p>
67 <p>
68 If you add a permission to the extension when you autoupdate it,
69 the user might see a new permission warning.
70 For example,
71 assume you add a new site and the "tabs" permission
72 to the previous example:
73 </p>
75 <pre data-filename="manifest.json">
76 "permissions": [
77 "http://api.flickr.com/",
78 <b>"http://*.flickr.com/",
79 "tabs"</b>
81 </pre>
83 <p>
84 When the extension autoupdates,
85 the increased permissions
86 cause the extension to be disabled
87 until the user re-enables it.
88 Here's the warning the user sees:
89 </p>
91 <img src="{{static}}/images/perms-hw2-disabled.png"
92 width="332" height="208"
93 alt="Warning text: 'The newest version of the extension Hello World requires more permissions, so it has been disabled. [Re-enable].'"
96 <p>
97 Clicking the Re-enable button
98 brings up the following warning:
99 </p>
101 <img src="{{static}}/images/perms-hw2.png"
102 width="490" height="193"
103 alt="Permission warning: 'It can: Access your data on api.flickr.com and flickr.com; Read and modify your browsing history'"
107 <h2 id="warnings"> Warnings and their triggers </h2>
110 It can be surprising when adding a permission such as "tabs"
111 results in the seemingly unrelated warning
112 that the extension can access your browsing activity.
113 The reason for the warning is that
114 although the <code>chrome.tabs</code> API
115 might be used only to open new tabs,
116 it can also be used to see the URL that's associated
117 with every newly opened tab
118 (using their $ref:tabs.Tab objects).
119 </p>
121 <p class="note">
122 <b>Note:</b>
123 As of Google Chrome 7,
124 you no longer need to specify the "tabs" permission
125 just to call <code>chrome.tabs.create()</code>
126 or <code>chrome.tabs.update()</code>.
127 </p>
130 The following table lists the warning messages
131 that users can see,
132 along with the manifest entries
133 that trigger them.
134 </p>
137 <table>
138 <tr>
139 <th> Warning message </th>
140 <th> Manifest entry that caused it </th>
141 <th> Notes </th>
142 </tr>
143 <tr>
144 <td style="font-weight:bold">
145 <!-- IDS_EXTENSION_PROMPT_WARNING_FULL_ACCESS -->
146 Access all data on your computer and the websites you visit
147 </td>
148 <td>
149 "plugins"
150 </td>
151 <td>
152 The "plugins" permission is required by
153 <a href="npapi.html">NPAPI plugins</a>.
154 </td>
155 </tr>
157 <tr>
158 <td style="font-weight:bold">
159 <!-- IDS_EXTENSION_PROMPT_WARNING_BOOKMARKS -->
160 Read and modify your bookmarks
161 </td>
162 <td>
163 "bookmarks" permission
164 </td>
165 <td>
166 The "bookmarks" permission is required by the
167 <a href="bookmarks.html"><code>chrome.bookmarks</code></a> module.
168 </td>
169 </tr>
171 <tr>
172 <td style="font-weight:bold">
173 <!-- IDS_EXTENSION_PROMPT_WARNING_BROWSING_HISTORY -->
174 Read and modify your browsing history
175 </td>
176 <td>
177 <!-- HasEffectiveBrowsingHistoryPermission -->
178 Any of the following:
179 <ul>
180 <li> "history" permission </li>
181 <li> "topSites" permission </li>
182 </ul>
183 </td>
184 <td>
186 The "history" permission is required by
187 <a href="history.html"><code>chrome.history</code></a>.
188 </p>
190 The "topSites" permission is required by
191 <a href="topSites.html"><code>chrome.topSites</code></a>.
192 </p>
193 </td>
194 </tr>
196 <tr>
197 <td style="font-weight:bold">
198 <!-- IDS_EXTENSION_PROMPT_WARNING_TABS -->
199 Access your tabs and browsing activity
200 </td>
201 <td>
202 <!-- HasEffectiveBrowsingHistoryPermission -->
203 Any of the following:
204 <ul>
205 <li> "tabs" permission </li>
206 <li> "webNavigation" permission </li>
207 </ul>
208 </td>
209 <td>
211 The "tabs" permission is required by the
212 <a href="tabs.html"><code>chrome.tabs</code></a> and
213 <a href="windows.html"><code>chrome.windows</code></a> modules.
214 </p>
216 The "webNavigation" permission is required by the
217 <a href="webNavigation.html"><code>chrome.webNavigation</code></a> module.
218 </p>
219 </td>
220 </tr>
222 <tr>
223 <td style="font-weight:bold">
224 <!-- IDS_EXTENSION_PROMPT_WARNING_CONTENT_SETTINGS -->
225 Manipulate settings that specify whether websites can use features such as cookies, JavaScript, and plug-ins
226 </td>
227 <td>
228 <!-- HasEffectiveBrowsingHistoryPermission -->
229 "contentSettings" permission
230 </td>
231 <td>
233 The "contentSettings" permission is required by
234 <a href="contentSettings.html"><code>chrome.contentSettings</code></a>.
235 </p>
236 </td>
237 </tr>
239 <tr>
240 <td style="font-weight:bold">
241 <!-- IDS_EXTENSION_PROMPT_WARNING_ALL_HOSTS -->
242 Access your data on all websites
243 </td>
244 <td>
245 <!-- HasEffectiveAccessToAllHosts() -->
246 Any of the following:
247 <ul>
248 <li> "debugger" permission </li>
249 <li> "pageCapture" permission </li>
250 <li> "proxy" permission </li>
251 <li> A match pattern in the "permissions" field
252 that matches all hosts </li>
253 <li> A&nbsp;"content_scripts" field with a "matches" entry
254 that matches all hosts </li>
255 <li> "devtools_page" </li>
256 </ul>
257 </td>
258 <td>
260 The "debugger" permission is required by the
261 <a href="debugger.html">debugger</a> module.
262 </p>
265 The "proxy" permission is required by the
266 <a href="proxy.html"><code>chrome.proxy</code></a> module.
267 </p>
270 Any of the following URLs match all hosts:
271 </p>
272 <ul>
273 <li> <code>http://*/*</code> </li>
274 <li> <code>https://*/*</code> </li>
275 <li> <code>*://*/*</code> </li>
276 <li> <code>&lt;all_urls&gt;</code> </li>
277 </ul>
278 <strong>Note that you may be able to avoid declaring all host permissions using the <code><a href="activeTab.html">activeTab</a></code> permission.</strong>
279 </td>
280 </tr>
281 <tr>
282 <td style="font-weight:bold">
283 <!-- IDS_EXTENSION_PROMPT_WARNING_?_HOST -->
284 <!-- IDS_EXTENSION_PROMPT_WARNING_4_OR_MORE_HOSTS -->
285 Access your data on <em>{list of websites}</em>
286 </td>
287 <td>
288 A match pattern in the "permissions" field
289 that specifies one or more hosts,
290 but not all hosts
291 </td>
292 <td>
294 Up to 3 sites are listed by name.
295 Subdomains aren't treated specially.
296 For example, <code>a.com</code> and <code>b.a.com</code>
297 are listed as different sites.
298 </p>
301 On autoupdate,
302 the user sees a permission warning
303 if the extension adds or changes sites.
304 For example, going from <code>a.com,b.com</code>
305 to <code>a.com,b.com,c.com</code>
306 triggers a warning.
307 Going from <code>b.a.com</code>
308 to <code>a.com</code>,
309 or vice versa,
310 also triggers a warning.
311 </p>
312 </td>
313 </tr>
315 <tr>
316 <td style="font-weight:bold">
317 <!-- IDS_EXTENSION_PROMPT_WARNING_MANAGEMENT -->
318 Manage your apps, extensions, and themes
319 </td>
320 <td>
321 "management" permission
322 </td>
323 <td>
324 The "management" permission is required by the
325 <a href="management.html"><code>chrome.management</code></a> module.
326 </td>
327 </tr>
329 <tr>
330 <td style="font-weight:bold">
331 <!-- IDS_EXTENSION_PROMPT_WARNING_GEOLOCATION -->
332 Detect your physical location
333 </td>
334 <td>
335 "geolocation" permission
336 </td>
337 <td>
338 Allows the extension to use the proposed HTML5
339 <a href="http://dev.w3.org/geo/api/spec-source.html">geolocation API</a>
340 without prompting the user for permission.
341 </td>
342 </tr>
344 <tr>
345 <td style="font-weight:bold">
346 <!-- IDS_EXTENSION_PROMPT_WARNING_CLIPBOARD-->
347 Access data you copy and paste
348 </td>
349 <td>
350 "clipboardRead" permission
351 </td>
352 <td>
353 Allows the extension to use the following editing commands with
354 <code>document.execCommand()</code>:
355 <ul>
356 <li> <code>"copy"</code> </li>
357 <li> <code>"cut"</code> </li>
358 </ul>
359 </td>
360 </tr>
362 <tr>
363 <td style="font-weight:bold">
364 <!-- IDS_EXTENSION_PROMPT_WARNING_PRIVACY-->
365 Manipulate privacy-related settings
366 </td>
367 <td>
368 "privacy" permission
369 </td>
370 <td>
371 The "privacy" permission is required by the
372 <a href="privacy.html"><code>chrome.privacy</code></a> module.
373 </td>
374 </tr>
376 <tr>
377 <td style="font-weight:bold">
378 <!-- IDS_EXTENSION_PROMPT_WARNING_SIGNED_IN_DEVICES-->
379 Access the list of your signed-in devices
380 </td>
381 <td>
382 "signedInDevices" permission
383 </td>
384 <td>
385 The "signedInDevices" permission is required by the
386 <a href="signedInDevices.html"><code>chrome.signedInDevices</code></a>
387 module.
388 </td>
389 </tr>
391 <tr>
392 <td style="font-weight:bold">
393 <!-- IDS_EXTENSION_PROMPT_WARNING_TTS_ENGINE-->
394 Access all text spoken using synthesized speech
395 </td>
396 <td>
397 "ttsEngine" permission
398 </td>
399 <td>
400 The "ttsEngine" permission is required by the
401 <a href="ttsEngine.html"><code>chrome.ttsEngine</code></a> module.
402 </td>
403 </tr>
404 </table>
405 </p>
408 <h2 id="nowarning"> Permissions that don't cause warnings </h2>
411 The following permissions don't result in a warning:
412 </p>
414 <ul>
415 <li>"activeTab"</li>
416 {{?is_apps}}
417 <li>"alwaysOnTopWindows"</li>
418 {{/is_apps}}
419 <li>"browsingData"</li>
420 <li>"chrome://favicon/"</li>
421 <li>"clipboardWrite"</li>
422 <li>"contextMenus"</li>
423 <li>"cookies"</li>
424 <li>"experimental"</li>
425 {{?is_apps}}
426 <li>"fullscreen"</li>
427 {{/is_apps}}
428 <li>"idle"</li>
429 <li>"notifications"</li>
430 {{?is_apps}}
431 <li>"pointerLock"</li>
432 {{/is_apps}}
433 <li>"storage"</li>
434 <li>"unlimitedStorage"</li>
435 <li>"webRequest"</li>
436 <li>"webRequestBlocking"</li>
437 </ul>
439 <h2 id="test"> Testing permission warnings </h2>
442 If you'd like to see exactly which warnings your users will get,
443 <a href="packaging.html">package your extension</a>
444 into a <code>.crx</code> file,
445 and install it.
446 </p>
449 To see the warnings users will get when your extension is autoupdated,
450 you can go to a little more trouble
451 and set up an autoupdate server.
452 To do this, first create an update manifest
453 and point to it from your extension,
454 using the "update_url" key
455 (see <a href="autoupdate.html">Autoupdating</a>).
456 Next, <a href="packaging.html">package the extension</a>
457 into a new <code>.crx</code> file,
458 and install the app from this <code>.crx</code> file.
459 Now, change the extension's manifest to contain the new permissions,
460 and <a href="packaging.html#update">repackage the extension</a>.
461 Finally, update the extension
462 (and all other extensions that have outstanding updates)
463 by clicking the <b>chrome://extensions</b> page's
464 <b>Update extensions now</b> button.
465 </p>
467 <h2 id="api">API</h2>
470 You can get a list of permission warnings for any manifest with
471 $ref:management.getPermissionWarningsByManifest.
472 </p>