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

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

Issue 8879039: Update the extension documentation to explain manifest_version. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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 | « no previous file | 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-name" class="pageData">Formats: Manifest Files</div> 1 <div id="pageData-name" 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, installable web app, and theme has a 5 Every extension, installable web app, and theme 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. 8 that provides important information.
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 always required 16 The only fields that are always required
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 <em>// Required</em> 22 <em>// Required</em>
23 "<a href="#name">name</a>": "<em>My Extension</em>", 23 "<a href="#name">name</a>": "<em>My Extension</em>",
24 "<a href="#version">version</a>": "<em>versionString</em>", 24 "<a href="#version">version</a>": "<em>versionString</em>",
25 "<a href="#manifest_version">manifest_version</a>": 2,
25 26
26 <em>// Recommended</em> 27 <em>// Recommended</em>
27 "<a href="#description">description</a>": "<em>A plain text description</em>", 28 "<a href="#description">description</a>": "<em>A plain text description</em>",
28 "<a href="#icons">icons</a>": { ... }, 29 "<a href="#icons">icons</a>": { ... },
29 "<a href="#default_locale">default_locale</a>": "<em>en</em>", 30 "<a href="#default_locale">default_locale</a>": "<em>en</em>",
30 31
31 <em>// Pick one (or none)</em> 32 <em>// Pick one (or none)</em>
32 "<a href="browserAction.html">browser_action</a>": {...}, 33 "<a href="browserAction.html">browser_action</a>": {...},
33 "<a href="pageAction.html">page_action</a>": {...}, 34 "<a href="pageAction.html">page_action</a>": {...},
34 "<a href="themes.html">theme</a>": {...}, 35 "<a href="themes.html">theme</a>": {...},
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 The description should be suitable for both 106 The description should be suitable for both
106 the browser's extension management UI 107 the browser's extension management UI
107 and the <a href="https://chrome.google.com/webstore">Chrome Web Store</a>. 108 and the <a href="https://chrome.google.com/webstore">Chrome Web Store</a>.
108 You can specify locale-specific strings for this field; 109 You can specify locale-specific strings for this field;
109 see <a href="i18n.html">Internationalization</a> for details. 110 see <a href="i18n.html">Internationalization</a> for details.
110 </p> 111 </p>
111 112
112 <h3 id="content_security_policy">content_security_policy</h3> 113 <h3 id="content_security_policy">content_security_policy</h3>
113 114
114 <p> 115 <p>
115 A security policy to apply to resources in your extension. 116 A security policy to apply to resources in your extension. You can use this
116 You can use this policy to help prevent cross-site scripting 117 policy to help prevent cross-site scripting vulnerabilities in your extension.
117 vulnerabilities in your extension. 118 By default, the extension system enforces the following policy:
118 To specify that your extension loads resources 119 </p>
119 only from its own package, use the following policy: 120
121 <pre>script-src 'self'; object-src 'self'</pre>
122
123 <p>
124 Extensions can tighten their policy using the
125 <code>content_security_policy</code> manifest attribute. For example, to
126 specify that your extension loads resources only from its own package, use the
127 following policy:
120 </p> 128 </p>
121 129
122 <pre>"content_security_policy": "default-src 'self' " </pre> 130 <pre>"content_security_policy": "default-src 'self' " </pre>
123 131
124 <p> 132 <p>
125 If you need to load resources from websites, 133 If you need to load resources from websites,
126 you can add them to the whitelist. 134 you can add them to the whitelist.
127 For example, if your extension uses Google Analytics, 135 For example, if your extension uses Google Analytics,
128 you might use the following policy: 136 you might use the following policy:
129 </p> 137 </p>
130 138
131 <pre>"content_security_policy": "default-src 'self' https://ssl.google-analytics .com"</pre> 139 <pre>"content_security_policy": "default-src 'self' https://ssl.google-analytics .com"</pre>
132 140
133 <p> 141 <p>
142 However, the extension system will prevent you including insecure resources
mkearney 2011/12/08 23:52:22 Suggestion to remove 'however'.
143 for <code>script-src</code> or <code>object-src</code>. (If you are using
mkearney 2011/12/08 23:52:22 Suggestion to take this sentence out of parenthese
144 <code>eval</code> to parse JSON, please consider using <code>JSON.parse</code>
145 instead.)
146 </p>
147
148 <p>
134 For details, see the 149 For details, see the
135 <a href="http://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specific ation.dev.html">Content Security Policy specification</a>. 150 <a href="http://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specific ation.dev.html">Content Security Policy specification</a>.
136 </p> 151 </p>
137 152
138 153
139 <h3 id="homepage_url">homepage_url</h3> 154 <h3 id="homepage_url">homepage_url</h3>
140 155
141 <p> 156 <p>
142 The URL of the homepage for this extension. The extensions management page (chro me://extensions) 157 The URL of the homepage for this extension. The extensions management page (chro me://extensions)
143 will contain a link to this URL. This field is particularly useful if you 158 will contain a link to this URL. This field is particularly useful if you
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 <p> 663 <p>
649 A missing integer is equal to zero. 664 A missing integer is equal to zero.
650 For example, 1.1.9.9999 is newer than 1.1. 665 For example, 1.1.9.9999 is newer than 1.1.
651 </p> 666 </p>
652 667
653 <p> 668 <p>
654 For more information, see 669 For more information, see
655 <a href="autoupdate.html">Autoupdating</a>. 670 <a href="autoupdate.html">Autoupdating</a>.
656 </p> 671 </p>
657 672
673
674 <h3 id="manifest_version">manifest_version</h3>
675
676 <p>
677 The version of the manifest format that this extension uses. Currently,
678 extensions should use the value <code>2</code> (without quotes):
679 </p>
680
681 <pre>"manifest_version": 2</pre>
682
683 <p>
684 A larger number might be required in the future if there are breaking changes
mkearney 2011/12/08 23:52:22 I think this can be worded better. How about: Fut
685 to the extension system.
686 </p>
687
688
658 <!-- [PENDING: Possibly: point to the store/dashboard and make a big deal of the fact that autoupdating is free if you use them.] --> 689 <!-- [PENDING: Possibly: point to the store/dashboard and make a big deal of the fact that autoupdating is free if you use them.] -->
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698