Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: chrome/common/extensions/docs/static/manifest.html

Issue 326008: Clarified the manifest example code. Added "version" description.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/extensions/docs/manifest.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <div id="pageData-title" class="pageData">Formats: Manifest Files</div> 1 <div id="pageData-title" class="pageData">Formats: Manifest Files</div>
2 <div id="pageData-showTOC" class="pageData">true</div> 2 <div id="pageData-showTOC" class="pageData">true</div>
3 3
4 <p> 4 <p>
5 Every extension has a 5 Every extension has a
6 <a href="http://www.json.org">JSON</a>-formatted manifest file, 6 <a href="http://www.json.org">JSON</a>-formatted manifest file,
7 named <code>manifest.json</code>, 7 named <code>manifest.json</code>,
8 that provides important information about the extension. 8 that provides important information about the extension.
9 </p> 9 </p>
10 10
11 <h2 id="overview"> Field summary </h2> 11 <h2 id="overview"> Field summary </h2>
12 12
13 <p> 13 <p>
14 The following code shows the supported manifest fields, 14 The following code shows the supported manifest fields,
15 with links to the page that discusses each field. 15 with links to the page that discusses each field.
16 The only fields that are required for every extension 16 The only fields that are required for every extension
17 are <b>name</b> and <b>version</b>. 17 are <b>name</b> and <b>version</b>.
18 </p> 18 </p>
19 19
20 <pre> 20 <pre>
21 { 21 {
22 <b>"<a href="#name">name</a>"</b>: "<em>My Extension</em>", 22 <em>// Required</em>
23 <b>"<a href="autoupdate.html">version</a>"</b>: "<em>versionString</em>", 23 "<a href="#name">name</a>": "<em>My Extension</em>",
24 "<a href="#version">version</a>": "<em>versionString</em>",
24 25
26 <em>// Recommended</em>
25 "<a href="#description">description</a>": "<em>A plain text description</em>", 27 "<a href="#description">description</a>": "<em>A plain text description</em>",
26 "<a href="#icons">icons</a>": { ... }, 28 "<a href="#icons">icons</a>": { ... },
27 "<a href="autoupdate.html">update_url</a>": "http://<em>path/to/updateInfo</em >.xml",
28 29
30 <em>// Pick one (or none)</em>
31 "<a href="browserAction.html">brower_action</a>": {...},
32 "<a href="pageAction.html">page_action</a>": {...},
33 "<a href="themes.html">theme</a>": {...},
34
35 <em>// Add any of these that you need</em>
29 "<a href="background_pages.html">background_page</a>": "<em>aFile</em>.html", 36 "<a href="background_pages.html">background_page</a>": "<em>aFile</em>.html",
30 "<a href="browserAction.html">brower_action</a>": {...},
31 "<a href="ntp.html">chrome_url_overrides</a>": {...}, 37 "<a href="ntp.html">chrome_url_overrides</a>": {...},
32 "<a href="content_scripts.html">content_scripts</a>": [...], 38 "<a href="content_scripts.html">content_scripts</a>": [...],
33 "<a href="pageAction.html">page_action</a>": {...}, 39 "<a href="options.html">options_page</a>": "<em>aFile</em>.html",
34 "<a href="#permissions">permissions</a>": [...], 40 "<a href="#permissions">permissions</a>": [...],
35 "<a href="npapi.html">plugins</a>": [...], 41 "<a href="npapi.html">plugins</a>": [...]
36 "<a href="themes.html">theme</a>": {...}, 42 "<a href="autoupdate.html">update_url</a>": "http://<em>path/to/updateInfo</em >.xml",
37 "<a href="toolstrip.html">toolstrips</a>": [...],
38 "<a href="options.html">options_page</a>": "<em>aFile</em>.html",
39 } 43 }
40 </pre> 44 </pre>
41 45
42 46
43 <h2>Field details</h2> 47 <h2>Field details</h2>
44 48
45 <p> 49 <p>
46 This section covers fields that aren't described in another page. 50 This section covers fields that aren't described in another page.
47 For a complete list of fields, 51 For a complete list of fields,
48 with links to where they're described in detail, 52 with links to where they're described in detail,
49 see the <a href="#overview">Field summary</a>. 53 see the <a href="#overview">Field summary</a>.
50 </p> 54 </p>
51 55
52 <h3 id="description">description</h3> 56 <h3 id="description">description</h3>
53 57
54 <p> 58 <p>
55 A plain text string 59 A plain text string
56 (no HTML or other formatting) 60 (no HTML or other formatting)
57 that describes the extension. 61 that describes the extension.
58 The description should be suitable for both 62 The description should be suitable for both
59 the browser's extension management UI 63 the browser's extension management UI
60 and the extension gallery. 64 and the extension gallery.
61 </p> 65 </p>
62 66
63 <h3 id="icon">icon</h3>
64
65 <p>
66 An icon that represents the extension.
67 As a rule, you should use the <b>icons</b> field instead,
68 so that you can specify icons in multiple sizes.
69 Here's an example of using this field:
70 </p>
71
72 <pre>
73 "icon": "icon.png",
74 </pre>
75 67
76 <h3 id="icons">icons</h3> 68 <h3 id="icons">icons</h3>
77 69
78 <p> 70 <p>
79 One or more icons that represent the extension. 71 One or more icons that represent the extension.
80 We recommend that you provide icons in four sizes &mdash; 72 We recommend that you provide icons in four sizes &mdash;
81 16x16, 32x32, 48x48, and 128x128 pixels. 73 16x16, 32x32, 48x48, and 128x128 pixels.
82 The icons can be in any format supported by WebKit, 74 The icons can be in any format supported by WebKit,
83 such as BMP, GIF, ICO, JPEG, or PNG. 75 such as BMP, GIF, ICO, JPEG, or PNG.
84 Here's an example of specifying all four icon sizes: 76 Here's an example of specifying all four icon sizes:
(...skipping 13 matching lines...) Expand all
98 A short, plain text string 90 A short, plain text string
99 that identifies the extension. 91 that identifies the extension.
100 The name is used in the install dialog, 92 The name is used in the install dialog,
101 extension management UI, 93 extension management UI,
102 and the extension gallery. 94 and the extension gallery.
103 </p> 95 </p>
104 96
105 <h3 id="permissions">permissions</h3> 97 <h3 id="permissions">permissions</h3>
106 98
107 <p> 99 <p>
108 The capabilities the extension might use. 100 An array of permissions that the extension might use.
109 A permission can be either one of a list of known strings 101 Each permission can be either one of a list of known strings
110 (currently, either "tabs" or "bookmarks") 102 (such as "tabs" or "bookmarks")
111 or a match pattern, 103 or a match pattern
112 which gives access to one or more hosts. 104 that gives access to one or more hosts.
113 The idea is not to restrict what you can do, 105 These permissions are displayed to users before installation.
114 but to give advanced users an indication of what your extension
115 will be able to do.
116 Permissions might also help to limit damage 106 Permissions might also help to limit damage
117 if your extension is attacked. 107 if your extension is attacked.
118 </p> 108 </p>
119 109
120 <p> 110 <p>
111 If an API requires you to declare a permission in the manifest,
112 then its documentation tells you how to do so.
113 For example,
114 the <a href="tabs.html">Tabs</a> page
115 shows you how to
116 declare the "tabs" permission.
117 </p>
118
119 <p>
121 Here's an example of the permissions part of a manifest file: 120 Here's an example of the permissions part of a manifest file:
122 </p> 121 </p>
123 122
124 <pre> 123 <pre>
125 "permissions": [ 124 "permissions": [
126 "tabs", 125 "tabs",
127 "bookmarks", 126 "bookmarks",
128 "http://www.blogger.com/", 127 "http://www.blogger.com/",
129 "http://*.google.com/" 128 "http://*.google.com/"
130 ], 129 ],
131 </pre> 130 </pre>
132 131
133 <p> 132 <p>
134 For more information, see 133 For more information, see
135 <a href="xhr.html">Cross-Origin XMLHttpRequest</a>, 134 <a href="xhr.html">Cross-Origin XMLHttpRequest</a>,
136 <a href="windows.html">Windows</a>, 135 <a href="windows.html">Windows</a>,
137 <a href="tabs.html">Tabs</a>, and 136 <a href="tabs.html">Tabs</a>, and
138 <a href="bookmarks.html">Bookmarks</a>. 137 <a href="bookmarks.html">Bookmarks</a>.
139 </p> 138 </p>
140 139
140 <h3 id="version">version</h3>
141
142 <p>
143 One to four dot-separated integers
144 identifying the version of this extension.
145 Examples:
146 </p>
147
148 <ul>
149 <li> <code>"version": "1"</code> </li>
150 <li> <code>"version": "1.0"</code> </li>
151 <li> <code>"version": "2.10.2"</code> </li>
152 <li> <code>"version": "3.1.2.4567"</code> </li>
153 </ul>
154
155 <p>
156 The autoupdate system compares versions
157 to determine whether an installed extension
158 needs to be updated.
159 If the published extension has a newer version string
160 than the installed extension,
161 then the extension is automatically updated.
162 </p>
163
164 <p>
165 The comparison starts with the leftmost integers.
166 If those integers are equal,
167 the integers to the right are compared,
168 and so on.
169 For example, 1.2.0 is a newer version than 1.1.9.99999.
170 </p>
171
172 <p>
173 A missing integer is equal to zero.
174 For example, 1.1.9.99999 is newer than 1.1.
175 </p>
176
177 <p>
178 For more information, see
179 <a href="autoupdate.html">Autoupdating</a>.
180 </p>
181
182 <p class="comment">
183 [PENDING: Once the gallery is published, point to it
184 and make a big deal of the fact that autoupdating is free
185 if you use the gallery.]
186 </p>
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/manifest.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698