1 <h1>Permission Warnings
</h1>
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).
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.
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.
35 <h2 id=
"examples"> Examples of permission warnings
</h2>
38 Here's a typical dialog
39 that a user might see when installing an extension:
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'"
48 The warning about access to data on api.flickr.com
49 is caused by the following lines
50 in the extension's manifest:
53 <pre data-filename=
"manifest.json">
55 <b>"http://api.flickr.com/"</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.
68 If you add a permission to the extension when you autoupdate it,
69 the user might see a new permission warning.
71 assume you add a new site and the
"tabs" permission
72 to the previous example:
75 <pre data-filename=
"manifest.json">
77 "http://api.flickr.com/",
78 <b>"http://*.flickr.com/",
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:
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].'"
97 Clicking the Re-enable button
98 brings up the following warning:
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).
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>.
130 The following table lists the warning messages
132 along with the manifest entries
139 <th> Warning message
</th>
140 <th> Manifest entry that caused it
</th>
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
152 The
"plugins" permission is required by
153 <a href=
"npapi.html">NPAPI plugins
</a>.
158 <td style=
"font-weight:bold">
159 <!-- IDS_EXTENSION_PROMPT_WARNING_BOOKMARKS -->
160 Read and modify your bookmarks
163 "bookmarks" permission
166 The
"bookmarks" permission is required by the
167 <a href=
"bookmarks.html"><code>chrome.bookmarks
</code></a> module.
172 <td style=
"font-weight:bold">
173 <!-- IDS_EXTENSION_PROMPT_WARNING_BROWSING_HISTORY -->
174 Read and modify your browsing history
177 <!-- HasEffectiveBrowsingHistoryPermission -->
178 Any of the following:
180 <li> "history" permission
</li>
181 <li> "topSites" permission
</li>
186 The
"history" permission is required by
187 <a href=
"history.html"><code>chrome.history
</code></a>.
190 The
"topSites" permission is required by
191 <a href=
"topSites.html"><code>chrome.topSites
</code></a>.
197 <td style=
"font-weight:bold">
198 <!-- IDS_EXTENSION_PROMPT_WARNING_TABS -->
199 Access your tabs and browsing activity
202 <!-- HasEffectiveBrowsingHistoryPermission -->
203 Any of the following:
205 <li> "tabs" permission
</li>
206 <li> "webNavigation" permission
</li>
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.
216 The
"webNavigation" permission is required by the
217 <a href=
"webNavigation.html"><code>chrome.webNavigation
</code></a> module.
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
228 <!-- HasEffectiveBrowsingHistoryPermission -->
229 "contentSettings" permission
233 The
"contentSettings" permission is required by
234 <a href=
"contentSettings.html"><code>chrome.contentSettings
</code></a>.
240 <td style=
"font-weight:bold">
241 <!-- IDS_EXTENSION_PROMPT_WARNING_ALL_HOSTS -->
242 Access your data on all websites
245 <!-- HasEffectiveAccessToAllHosts() -->
246 Any of the following:
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
"content_scripts" field with a
"matches" entry
254 that matches all hosts
</li>
255 <li> "devtools_page" </li>
260 The
"debugger" permission is required by the
261 <a href=
"debugger.html">debugger
</a> module.
265 The
"proxy" permission is required by the
266 <a href=
"proxy.html"><code>chrome.proxy
</code></a> module.
270 Any of the following URLs match all hosts:
273 <li> <code>http://*/*
</code> </li>
274 <li> <code>https://*/*
</code> </li>
275 <li> <code>*://*/*
</code> </li>
276 <li> <code><all_urls
></code> </li>
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>
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>
288 A match pattern in the
"permissions" field
289 that specifies one or more hosts,
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.
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>
307 Going from
<code>b.a.com
</code>
308 to
<code>a.com
</code>,
310 also triggers a warning.
316 <td style=
"font-weight:bold">
317 <!-- IDS_EXTENSION_PROMPT_WARNING_MANAGEMENT -->
318 Manage your apps, extensions, and themes
321 "management" permission
324 The
"management" permission is required by the
325 <a href=
"management.html"><code>chrome.management
</code></a> module.
330 <td style=
"font-weight:bold">
331 <!-- IDS_EXTENSION_PROMPT_WARNING_GEOLOCATION -->
332 Detect your physical location
335 "geolocation" permission
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.
345 <td style=
"font-weight:bold">
346 <!-- IDS_EXTENSION_PROMPT_WARNING_CLIPBOARD-->
347 Access data you copy and paste
350 "clipboardRead" permission
353 Allows the extension to use the following editing commands with
354 <code>document.execCommand()
</code>:
356 <li> <code>"copy"</code> </li>
357 <li> <code>"cut"</code> </li>
363 <td style=
"font-weight:bold">
364 <!-- IDS_EXTENSION_PROMPT_WARNING_PRIVACY-->
365 Manipulate privacy-related settings
371 The
"privacy" permission is required by the
372 <a href=
"privacy.html"><code>chrome.privacy
</code></a> module.
377 <td style=
"font-weight:bold">
378 <!-- IDS_EXTENSION_PROMPT_WARNING_SIGNED_IN_DEVICES-->
379 Access the list of your signed-in devices
382 "signedInDevices" permission
385 The
"signedInDevices" permission is required by the
386 <a href=
"signedInDevices.html"><code>chrome.signedInDevices
</code></a>
392 <td style=
"font-weight:bold">
393 <!-- IDS_EXTENSION_PROMPT_WARNING_TTS_ENGINE-->
394 Access all text spoken using synthesized speech
397 "ttsEngine" permission
400 The
"ttsEngine" permission is required by the
401 <a href=
"ttsEngine.html"><code>chrome.ttsEngine
</code></a> module.
408 <h2 id=
"nowarning"> Permissions that don't cause warnings
</h2>
411 The following permissions don't result in a warning:
417 <li>"alwaysOnTopWindows"</li>
419 <li>"browsingData"</li>
420 <li>"chrome://favicon/"</li>
421 <li>"clipboardWrite"</li>
422 <li>"contextMenus"</li>
424 <li>"experimental"</li>
426 <li>"fullscreen"</li>
429 <li>"notifications"</li>
431 <li>"pointerLock"</li>
434 <li>"unlimitedStorage"</li>
435 <li>"webRequest"</li>
436 <li>"webRequestBlocking"</li>
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,
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.
467 <h2 id=
"api">API
</h2>
470 You can get a list of permission warnings for any manifest with
471 $ref:management.getPermissionWarningsByManifest.