OLD | NEW |
1 <h1>Autoupdating</h1> | 1 <h1>Autoupdating</h1> |
2 | 2 |
3 | 3 |
4 <p>We want extensions to be autoupdated for some of the same reasons as Google C
hrome itself: to incorporate bug and security fixes, add new features or perform
ance enhancements, and improve user interfaces.</p> | 4 <p>We want extensions to be autoupdated for some of the same reasons as Google C
hrome itself: to incorporate bug and security fixes, add new features or perform
ance enhancements, and improve user interfaces.</p> |
5 | 5 |
6 <p>If you publish your extension using the <a href="https://chrome.google.com/we
bstore/developer/dashboard">Chrome Developer Dashboard</a>, you can <em>ignore t
his page</em>. You can use the dashboard to release updated versions of your ext
ension to users, as well as to the Chrome Web Store.</p> | 6 <p>If you publish your extension using the <a href="https://chrome.google.com/we
bstore/developer/dashboard">Chrome Developer Dashboard</a>, you can <em>ignore t
his page</em>. You can use the dashboard to release updated versions of your ext
ension to users, as well as to the Chrome Web Store.</p> |
7 | 7 |
8 <p>If you want to host your extension somewhere other than the store, keep readi
ng. | 8 <p>If you want to host your extension somewhere other than the store, keep readi
ng. |
9 You should also read <a href="hosting.html">Hosting</a> and | 9 You should also read <a href="hosting.html">Hosting</a> and |
10 <a href="packaging.html">Packaging</a>.</p> | 10 <a href="packaging.html">Packaging</a>.</p> |
11 | 11 |
12 | 12 |
13 <h2>Overview</h2> | 13 <h2 id="overview">Overview</h2> |
14 <ul><li>An extension manifest may contain an "update_url" field, pointing to a l
ocation for doing update checks.</li> | 14 <ul><li>An extension manifest may contain an "update_url" field, pointing to a l
ocation for doing update checks.</li> |
15 <li>The content returned by an update check is an <em>update manifest</em> XML d
ocument listing the latest version of an extension.</li></ul> | 15 <li>The content returned by an update check is an <em>update manifest</em> XML d
ocument listing the latest version of an extension.</li></ul> |
16 | 16 |
17 <p>Every few hours, the browser checks whether any installed extensions have an
update URL. For each one, it makes a request to that URL looking for an update m
anifest XML file. If the update manifest mentions a version of an extension that
is more recent than what's installed, the browser downloads and installs the ne
w version. As with manual updates, the new <code>.crx</code> file must be signed
with the same private key as the currently installed version.</p> | 17 <p>Every few hours, the browser checks whether any installed extensions have an
update URL. For each one, it makes a request to that URL looking for an update m
anifest XML file. If the update manifest mentions a version of an extension that
is more recent than what's installed, the browser downloads and installs the ne
w version. As with manual updates, the new <code>.crx</code> file must be signed
with the same private key as the currently installed version.</p> |
18 | 18 |
19 | 19 |
20 <h2>Update URL</h2> | 20 <h2 id="update_url">Update URL</h2> |
21 <p>If you're hosting your own extension, you need to add the "update_url" field
to your <a href="manifest.html"><code>manifest.json</code></a> file, | 21 <p>If you're hosting your own extension, you need to add the "update_url" field
to your <a href="manifest.html"><code>manifest.json</code></a> file, |
22 like this:</p> | 22 like this:</p> |
23 | 23 |
24 <pre>{ | 24 <pre>{ |
25 "name": "My extension", | 25 "name": "My extension", |
26 ... | 26 ... |
27 <b>"update_url": "http://myhost.com/mytestextension/updates.xml"</b>, | 27 <b>"update_url": "http://myhost.com/mytestextension/updates.xml"</b>, |
28 ... | 28 ... |
29 } | 29 } |
30 </pre> | 30 </pre> |
31 | 31 |
32 <h2>Update manifest</h2> | 32 <h2 id="update_manifest">Update manifest</h2> |
33 <p>The update manifest returned by the server should be an XML document that loo
ks like this (highlights indicate parts you should modify):</p> | 33 <p>The update manifest returned by the server should be an XML document that loo
ks like this (highlights indicate parts you should modify):</p> |
34 | 34 |
35 <pre> | 35 <pre> |
36 <?xml version='1.0' encoding='UTF-8'?> | 36 <?xml version='1.0' encoding='UTF-8'?> |
37 <gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'> | 37 <gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'> |
38 <app appid='<b>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</b>'> | 38 <app appid='<b>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</b>'> |
39 <updatecheck codebase='<b>http://myhost.com/mytestextension/mte
_v2.crx</b>' version='<b>2.0</b>' /> | 39 <updatecheck codebase='<b>http://myhost.com/mytestextension/mte
_v2.crx</b>' version='<b>2.0</b>' /> |
40 </app> | 40 </app> |
41 </gupdate> | 41 </gupdate> |
42 </pre> | 42 </pre> |
(...skipping 23 matching lines...) Expand all Loading... |
66 </ul> | 66 </ul> |
67 | 67 |
68 <p><b>codebase</b><br> | 68 <p><b>codebase</b><br> |
69 A URL to the extension's <code>.crx</code> file.</p> | 69 A URL to the extension's <code>.crx</code> file.</p> |
70 | 70 |
71 <p><b>version</b><br> | 71 <p><b>version</b><br> |
72 Used by the client to determine whether it should download the <code>.crx</code>
file specified by <code>codebase</code>. It should match the value of "version"
in the <code>.crx</code> file's <code>manifest.json</code> file.</p> | 72 Used by the client to determine whether it should download the <code>.crx</code>
file specified by <code>codebase</code>. It should match the value of "version"
in the <code>.crx</code> file's <code>manifest.json</code> file.</p> |
73 <p>The update manifest XML file may contain information about multiple extension
s by including multiple <app> elements.</p> | 73 <p>The update manifest XML file may contain information about multiple extension
s by including multiple <app> elements.</p> |
74 | 74 |
75 | 75 |
76 <h2>Testing</h2> | 76 <h2 id="testing">Testing</h2> |
77 <p>The default update check frequency is several hours, | 77 <p>The default update check frequency is several hours, |
78 but you can force an update using the Extensions page's | 78 but you can force an update using the Extensions page's |
79 <b>Update extensions now</b> button. | 79 <b>Update extensions now</b> button. |
80 </p> | 80 </p> |
81 | 81 |
82 <p> | 82 <p> |
83 Another option is to use the --extensions-update-frequency command-line flag to
set a more frequent interval in seconds. For example, to make checks run every 4
5 seconds, run Google Chrome like this:</p> | 83 Another option is to use the --extensions-update-frequency command-line flag to
set a more frequent interval in seconds. For example, to make checks run every 4
5 seconds, run Google Chrome like this:</p> |
84 <pre> | 84 <pre> |
85 chrome.exe <b>--extensions-update-frequency=45</b></pre> | 85 chrome.exe <b>--extensions-update-frequency=45</b></pre> |
86 | 86 |
87 <p>Note that this affects checks for all installed extensions, so consider the b
andwidth and server load implications of this. You may want to temporarily unins
tall all but the one extension you are testing with, and should not run with thi
s option turned on during normal browser usage.</p> | 87 <p>Note that this affects checks for all installed extensions, so consider the b
andwidth and server load implications of this. You may want to temporarily unins
tall all but the one extension you are testing with, and should not run with thi
s option turned on during normal browser usage.</p> |
88 | 88 |
89 | 89 |
90 <h2>Advanced usage: request parameters</h2> | 90 <h2 id="request_parameters">Advanced usage: request parameters</h2> |
91 <p>The basic autoupdate mechanism is designed to make the server-side work as ea
sy as just dropping a static XML file onto any plain web server such as Apache,
and updating that XML file as you release new versions of your extensions.</p> | 91 <p>The basic autoupdate mechanism is designed to make the server-side work as ea
sy as just dropping a static XML file onto any plain web server such as Apache,
and updating that XML file as you release new versions of your extensions.</p> |
92 <p>More advanced developers may wish to take advantage of the fact that we add o
n parameters to the request for the update manifest to indicate the extension ID
and version. Then they can use the same update URL for all of their extensions,
pointing to a URL running dynamic server-side code instead of a static XML file
.</p> | 92 <p>More advanced developers may wish to take advantage of the fact that we add o
n parameters to the request for the update manifest to indicate the extension ID
and version. Then they can use the same update URL for all of their extensions,
pointing to a URL running dynamic server-side code instead of a static XML file
.</p> |
93 <p>The format of the request parameters is:</p> | 93 <p>The format of the request parameters is:</p> |
94 <p><code> ?x=<em><extension_data></em></code></p> | 94 <p><code> ?x=<em><extension_data></em></code></p> |
95 <p>Where <code><em><extension_data></em></code> is a URL-encoded string of
the format:</p> | 95 <p>Where <code><em><extension_data></em></code> is a URL-encoded string of
the format:</p> |
96 <p><code> <em>id=<id></em>&v=<em><version></em></code
></p> | 96 <p><code> <em>id=<id></em>&v=<em><version></em></code
></p> |
97 | 97 |
98 <p>For example, say you have two extensions, | 98 <p>For example, say you have two extensions, |
99 both of which point to the same update URL | 99 both of which point to the same update URL |
100 (<code>http://test.com/extension_updates.php</code>): | 100 (<code>http://test.com/extension_updates.php</code>): |
(...skipping 28 matching lines...) Expand all Loading... |
129 | 129 |
130 <p>If the number of installed extensions using the same update URL is large enou
gh that a GET request URL is too long (over 2000 characters or so), the update c
heck issues additional GET requests as necessary.</p> | 130 <p>If the number of installed extensions using the same update URL is large enou
gh that a GET request URL is too long (over 2000 characters or so), the update c
heck issues additional GET requests as necessary.</p> |
131 | 131 |
132 <p class="note"> | 132 <p class="note"> |
133 <b>Note:</b> | 133 <b>Note:</b> |
134 In the future, instead of issuing multiple GET requests, | 134 In the future, instead of issuing multiple GET requests, |
135 a single POST request might be issued | 135 a single POST request might be issued |
136 with the request parameters in the POST body. | 136 with the request parameters in the POST body. |
137 </p> | 137 </p> |
138 | 138 |
139 <h2>Advanced usage: minimum browser version</h2> | 139 <h2 id="minimum_browser_version">Advanced usage: minimum browser version</h2> |
140 <p>As we add more APIs to the extensions system, it's possible you will want to
release an updated version of an extension that will work only with newer versio
ns of the browser. While Google Chrome itself is autoupdated, it can take a few
days before the majority of the user base has updated to any given new release.
To ensure that a given extension update will apply only to Google Chrome version
s at or higher than a specific version, you add the "prodversionmin" attribute t
o the <app> element in your update manifest. For example:</p> | 140 <p>As we add more APIs to the extensions system, it's possible you will want to
release an updated version of an extension that will work only with newer versio
ns of the browser. While Google Chrome itself is autoupdated, it can take a few
days before the majority of the user base has updated to any given new release.
To ensure that a given extension update will apply only to Google Chrome version
s at or higher than a specific version, you add the "prodversionmin" attribute t
o the <app> element in your update manifest. For example:</p> |
141 | 141 |
142 <pre><?xml version='1.0' encoding='UTF-8'?> | 142 <pre><?xml version='1.0' encoding='UTF-8'?> |
143 <gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'> | 143 <gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'> |
144 <app appid='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'> | 144 <app appid='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'> |
145 <updatecheck codebase='http://myhost.com/mytestextens
ion/mte_v2.crx' version='2.0' <b>prodversionmin='3.0.193.0'</b>/> | 145 <updatecheck codebase='http://myhost.com/mytestextens
ion/mte_v2.crx' version='2.0' <b>prodversionmin='3.0.193.0'</b>/> |
146 </app> | 146 </app> |
147 </gupdate> | 147 </gupdate> |
148 </pre> | 148 </pre> |
149 | 149 |
150 <p>This would ensure that users of this extension would autoupdate to version 2
only if they are running Google Chrome 3.0.193.0 or greater.</p> | 150 <p>This would ensure that users of this extension would autoupdate to version 2
only if they are running Google Chrome 3.0.193.0 or greater.</p> |
OLD | NEW |