- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / common / extensions / docs / templates / articles / declare_permissions.html
1 <h1>Declare Permissions</h1>
2
3 <p>
4 To use most chrome.* APIs,
5 your extension or app must declare its intent in the
6 "permissions" field of the
7 <a href="manifest.html">manifest</a>.
8 Each permission can be either one of a list of known strings
9 (such as "geolocation")
10 or a <a href="match_patterns.html">match pattern</a>
11 that gives access to one or more hosts.
12 Permissions help to limit damage
13 if your extension or app is compromised by malware.
14 Some permissions are also displayed to users before installation,
15 as detailed in
16 <a href="permission_warnings.html">Permission Warnings</a>.
17 </p>
18
19 <p>
20 If an API requires you to declare a permission in the manifest,
21 then its documentation tells you how to do so.
22 For example,
23 the <a href="storage.html">Storage</a> page
24 shows you how to
25 declare the "storage" permission.
26 </p>
27
28 <p id="manifest">
29 Here's an example of the permissions part of a manifest file:
30 </p>
31
32 <pre data-filename="manifest.json">
33 {{^is_apps}}
34 "permissions": [
35   "tabs",
36   "bookmarks",
37   "http://www.blogger.com/",
38   "http://*.google.com/",
39   "unlimitedStorage"
40 ],
41 {{/is_apps}}
42
43 {{?is_apps}}
44 "permissions": [
45   "serial",
46   "storage",
47   "videoCapture"
48 ],
49 {{/is_apps}}
50 </pre>
51
52 <p>
53 The following table lists the currently available permissions:
54 </p>
55
56 <table>
57   <tr>
58     <th>Permission</th>
59     <th>Description</th>
60   </tr>
61   {{#permissions}}
62   <tr id="{{anchor}}">
63     <td>
64       <code>"{{name}}"</code>
65     </td>
66     <td>
67       {{+description platform:platform name:name}}
68     </td>
69   </tr>
70   {{/permissions}}
71 </table>