| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html><!-- This page is a placeholder for generated extensions api doc.
Note: | |
| 2 1) The <head> information in this page is significant, should be uniform | |
| 3 across api docs and should be edited only with knowledge of the | |
| 4 templating mechanism. | |
| 5 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a | |
| 6 browser, it will be re-generated from the template, json schema and | |
| 7 authored overview content. | |
| 8 4) The <body>.innerHTML is also generated by an offline step so that this | |
| 9 page may easily be indexed by search engines. | |
| 10 --><html xmlns="http://www.w3.org/1999/xhtml"><head> | |
| 11 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
| 12 <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> | |
| 13 <link href="css/print.css" rel="stylesheet" type="text/css" media="print"> | |
| 14 <script type="text/javascript" src="../../../third_party/jstemplate/jstempla
te_compiled.js"> | |
| 15 </script> | |
| 16 <script type="text/javascript" src="../../../../third_party/json_minify/mini
fy-sans-regexp.js"> | |
| 17 </script> | |
| 18 <script type="text/javascript" src="js/api_page_generator.js"></script> | |
| 19 <script type="text/javascript" src="js/bootstrap.js"></script> | |
| 20 <script type="text/javascript" src="js/sidebar.js"></script> | |
| 21 <title>Packaging - Google Chrome Extensions - Google Code</title></head> | |
| 22 <body> <div id="devModeWarning" class="displayModeWarning"> | |
| 23 You are viewing extension docs in chrome via the 'file:' scheme: are you exp
ecting to see local changes when you refresh? You'll need run chrome with --allo
w-file-access-from-files. | |
| 24 </div> | |
| 25 <div id="branchWarning" class="displayModeWarning"> | |
| 26 <span>WARNING: This is the <span id="branchName">BETA</span> documentation. | |
| 27 It may not work with the stable release of Chrome.</span> | |
| 28 <select id="branchChooser"> | |
| 29 <option>Choose a different version... | |
| 30 </option><option value="">Stable | |
| 31 </option><option value="beta">Beta | |
| 32 </option><option value="dev">Dev | |
| 33 </option><option value="trunk">Trunk | |
| 34 </option></select> | |
| 35 </div> | |
| 36 <div id="unofficialWarning" class="displayModeWarning"> | |
| 37 <span>WARNING: This is unofficial documentation. It may not work with the | |
| 38 current release of Chrome.</span> | |
| 39 <button id="goToOfficialDocs">Go to the official docs</button> | |
| 40 </div> | |
| 41 <div id="gc-container" class="labs"> | |
| 42 <!-- SUBTEMPLATES: DO NOT MOVE FROM THIS LOCATION --> | |
| 43 <!-- In particular, sub-templates that recurse, must be used by allowing | |
| 44 jstemplate to make a copy of the template in this section which | |
| 45 are not operated on by way of the jsskip="true" --> | |
| 46 <!-- /SUBTEMPLATES --> | |
| 47 <a id="top"></a> | |
| 48 <div id="skipto"> | |
| 49 <a href="#gc-pagecontent">Skip to page content</a> | |
| 50 <a href="#gc-toc">Skip to main navigation</a> | |
| 51 </div> | |
| 52 <!-- API HEADER --> | |
| 53 <table id="header" width="100%" cellspacing="0" border="0"> | |
| 54 <tbody><tr> | |
| 55 <td valign="middle"><a href="http://code.google.com/"><img src="images/c
ode_labs_logo.gif" height="43" width="161" alt="Google Code Labs" style="border:
0; margin:0;"></a></td> | |
| 56 <td valign="middle" width="100%" style="padding-left:0.6em;"> | |
| 57 <form action="http://www.google.com/cse" id="cse" style="margin-top:0.
5em"> | |
| 58 <div id="gsc-search-box"> | |
| 59 <input type="hidden" name="cx" value="002967670403910741006:61_cvz
fqtno"> | |
| 60 <input type="hidden" name="ie" value="UTF-8"> | |
| 61 <input type="text" name="q" value="" size="55"> | |
| 62 <input class="gsc-search-button" type="submit" name="sa" value="Se
arch"> | |
| 63 <br> | |
| 64 <span class="greytext">e.g. "page action" or "tabs"</span> | |
| 65 </div> | |
| 66 </form> | |
| 67 <script type="text/javascript" src="https://www.google.com/jsapi"></sc
ript> | |
| 68 <script type="text/javascript">google.load("elements", "1", {packages:
"transliteration"});</script> | |
| 69 <script type="text/javascript" src="https://www.google.com/coop/cse/t1
3n?form=cse&t13n_langs=en"></script> | |
| 70 <script type="text/javascript" src="https://www.google.com/coop/cse/br
and?form=cse&lang=en"></script> | |
| 71 </td> | |
| 72 </tr> | |
| 73 </tbody></table> | |
| 74 <div id="codesiteContent" class=""> | |
| 75 <a id="gc-topnav-anchor"></a> | |
| 76 <div id="gc-topnav"> | |
| 77 <h1>Google Chrome Extensions (<a href="http://code.google.com/labs/">Lab
s</a>)</h1> | |
| 78 <ul id="home" class="gc-topnav-tabs"> | |
| 79 <li id="home_link"> | |
| 80 <a href="index.html" title="Google Chrome Extensions home page">Home
</a> | |
| 81 </li> | |
| 82 <li id="docs_link"> | |
| 83 <a href="docs.html" title="Official Google Chrome Extensions documen
tation">Docs</a> | |
| 84 </li> | |
| 85 <li id="faq_link"> | |
| 86 <a href="faq.html" title="Answers to frequently asked questions abou
t Google Chrome Extensions">FAQ</a> | |
| 87 </li> | |
| 88 <li id="samples_link"> | |
| 89 <a href="samples.html" title="Sample extensions (with source code)">
Samples</a> | |
| 90 </li> | |
| 91 <li id="group_link"> | |
| 92 <a href="http://groups.google.com/a/chromium.org/group/chromium-exte
nsions" title="Google Chrome Extensions developer forum">Group</a> | |
| 93 </li> | |
| 94 <li id="so_link"> | |
| 95 <a href="http://stackoverflow.com/questions/tagged/google-chrome-ext
ension" title="[google-chrome-extension] tag on Stack Overflow">Questions?</a> | |
| 96 </li> | |
| 97 </ul> | |
| 98 </div> <!-- end gc-topnav --> | |
| 99 <div class="g-section g-tpl-170"> | |
| 100 <!-- SIDENAV --> | |
| 101 <div class="g-unit g-first" id="gc-toc"> | |
| 102 <ul> | |
| 103 <li><a href="getstarted.html">Getting Started</a></li> | |
| 104 <li><a href="overview.html">Overview</a></li> | |
| 105 <li><a href="whats_new.html">What's New?</a></li> | |
| 106 <li><h2><a href="devguide.html">Developer's Guide</a></h2> | |
| 107 <ul> | |
| 108 <li>Browser UI | |
| 109 <ul> | |
| 110 <li><a href="browserAction.html">Browser Actions</a></li> | |
| 111 <li><a href="contextMenus.html">Context Menus</a></li> | |
| 112 <li><a href="notifications.html">Desktop Notifications</a></li
> | |
| 113 <li><a href="omnibox.html">Omnibox</a></li> | |
| 114 <li><a href="options.html">Options Pages</a></li> | |
| 115 <li><a href="override.html">Override Pages</a></li> | |
| 116 <li><a href="pageAction.html">Page Actions</a></li> | |
| 117 </ul> | |
| 118 </li> | |
| 119 <li>Browser Interaction | |
| 120 <ul> | |
| 121 <li><a href="bookmarks.html">Bookmarks</a></li> | |
| 122 <li><a href="cookies.html">Cookies</a></li> | |
| 123 <li><a href="devtools.html">Developer Tools</a></li> | |
| 124 <li><a href="events.html">Events</a></li> | |
| 125 <li><a href="history.html">History</a></li> | |
| 126 <li><a href="management.html">Management</a></li> | |
| 127 <li><a href="tabs.html">Tabs</a></li> | |
| 128 <li><a href="windows.html">Windows</a></li> | |
| 129 </ul> | |
| 130 </li> | |
| 131 <li>Implementation | |
| 132 <ul> | |
| 133 <li><a href="a11y.html">Accessibility</a></li> | |
| 134 <li><a href="background_pages.html">Background Pages</a></li> | |
| 135 <li><a href="content_scripts.html">Content Scripts</a></li> | |
| 136 <li><a href="xhr.html">Cross-Origin XHR</a></li> | |
| 137 <li><a href="i18n.html">Internationalization</a></li> | |
| 138 <li><a href="messaging.html">Message Passing</a></li> | |
| 139 <li><a href="permissions.html">Optional Permissions</a></li> | |
| 140 <li><a href="npapi.html">NPAPI Plugins</a></li> | |
| 141 </ul> | |
| 142 </li> | |
| 143 <li>Finishing | |
| 144 <ul> | |
| 145 <li><a href="hosting.html">Hosting</a></li> | |
| 146 <li><a href="external_extensions.html">Other Deployment Option
s</a></li> | |
| 147 </ul> | |
| 148 </li> | |
| 149 </ul> | |
| 150 </li> | |
| 151 <li><h2><a href="apps.html">Packaged Apps</a></h2></li> | |
| 152 <li><h2><a href="tutorials.html">Tutorials</a></h2> | |
| 153 <ul> | |
| 154 <li><a href="tut_debugging.html">Debugging</a></li> | |
| 155 <li><a href="tut_analytics.html">Google Analytics</a></li> | |
| 156 <li><a href="tut_oauth.html">OAuth</a></li> | |
| 157 </ul> | |
| 158 </li> | |
| 159 <li><h2>Reference</h2> | |
| 160 <ul> | |
| 161 <li>Formats | |
| 162 <ul> | |
| 163 <li><a href="manifest.html">Manifest Files</a></li> | |
| 164 <li><a href="match_patterns.html">Match Patterns</a></li> | |
| 165 </ul> | |
| 166 </li> | |
| 167 <li><a href="permission_warnings.html">Permission Warnings</a></li
> | |
| 168 <li><a href="api_index.html">chrome.* APIs</a></li> | |
| 169 <li><a href="api_other.html">Other APIs</a></li> | |
| 170 </ul> | |
| 171 </li> | |
| 172 <li><h2><a href="samples.html">Samples</a></h2></li> | |
| 173 <div class="line"> </div> | |
| 174 <li><h2>More</h2> | |
| 175 <ul> | |
| 176 <li><a href="http://code.google.com/chrome/webstore/docs/index.htm
l">Chrome Web Store</a></li> | |
| 177 <li><a href="http://code.google.com/chrome/apps/docs/developers_gu
ide.html">Hosted Apps</a></li> | |
| 178 <li><a href="themes.html">Themes</a></li> | |
| 179 </ul> | |
| 180 </li> | |
| 181 </ul> | |
| 182 </div> | |
| 183 <script> | |
| 184 initToggles(); | |
| 185 </script> | |
| 186 <div class="g-unit" id="gc-pagecontent"> | |
| 187 <div id="pageTitle"> | |
| 188 <h1 class="page_title">Packaging</h1> | |
| 189 </div> | |
| 190 <!-- TABLE OF CONTENTS --> | |
| 191 <div id="toc"> | |
| 192 <h2>Contents</h2> | |
| 193 <ol> | |
| 194 <li> | |
| 195 <a href="#H2-0">Creating a package</a> | |
| 196 <ol> | |
| 197 </ol> | |
| 198 </li><li> | |
| 199 <a href="#update">Updating a package</a> | |
| 200 <ol> | |
| 201 </ol> | |
| 202 </li><li> | |
| 203 <a href="#upload"> Uploading a previously packaged extension to th
e Chrome Web Store</a> | |
| 204 <ol> | |
| 205 </ol> | |
| 206 </li><li> | |
| 207 <a href="#H2-3">Packaging at the command line</a> | |
| 208 <ol> | |
| 209 </ol> | |
| 210 </li><li> | |
| 211 <a href="#H2-4">Package format and scripts</a> | |
| 212 <ol> | |
| 213 </ol> | |
| 214 </li> | |
| 215 </ol> | |
| 216 </div> | |
| 217 <!-- /TABLE OF CONTENTS --> | |
| 218 <!-- Standard content lead-in for experimental API pages --> | |
| 219 <!-- STATIC CONTENT PLACEHOLDER --> | |
| 220 <div id="static"><div id="pageData-name" class="pageData">Packaging</div
> | |
| 221 <div id="pageData-showTOC" class="pageData">true</div> | |
| 222 <p> | |
| 223 This page describes how to package your extension. | |
| 224 As the <a href="overview.html">Overview</a> explains, | |
| 225 extensions are packaged as signed ZIP files | |
| 226 with the file extension "crx"—for example, | |
| 227 <code>myextension.crx</code>. | |
| 228 </p> | |
| 229 <p> | |
| 230 <b>Note:</b> | |
| 231 You might not need to package your extension. | |
| 232 If you publish your extension using the | |
| 233 <a href="https://chrome.google.com/webstore/developer/dashboard">Chrome Develope
r Dashboard</a>, | |
| 234 then the only reason to create your own <code>.crx</code> file | |
| 235 would be to distribute a non-public version—for example, | |
| 236 to alpha testers. | |
| 237 You can find information on publishing extensions and apps in the | |
| 238 Chrome Web Store getting started tutorial, starting at | |
| 239 <a href="http://code.google.com/chrome/webstore/docs/get_started_simple.html#ste
p5">Step 5: Zip up your app</a>. | |
| 240 </p> | |
| 241 <p> | |
| 242 When you package an extension, | |
| 243 the extension is assigned a unique key pair. | |
| 244 The extension's ID is based on a hash of the public key. | |
| 245 The private key is kept private | |
| 246 and used to sign each version of the extension. | |
| 247 </p> | |
| 248 <a name="H2-0"></a><h2>Creating a package</h2> | |
| 249 <p>To package an extension:</p> | |
| 250 <ol> | |
| 251 <li> | |
| 252 Bring up the Extensions management page | |
| 253 by going to this URL: | |
| 254 <blockquote> | |
| 255 <b>chrome://extensions</b> | |
| 256 </blockquote> | |
| 257 </li> | |
| 258 <li> | |
| 259 If <b>Developer mode</b> has a + by it, | |
| 260 click the +. | |
| 261 </li> | |
| 262 <li> | |
| 263 Click the <b>Pack extension</b> button. | |
| 264 A dialog appears. | |
| 265 </li> | |
| 266 <li> | |
| 267 In the <b>Extension root directory</b> field, | |
| 268 specify the path to the extension's folder—for example, | |
| 269 <code>c:\myext</code>. | |
| 270 (Ignore the other field; | |
| 271 you don't specify a private key file | |
| 272 the first time you package a particular extension.) | |
| 273 </li> | |
| 274 <li> | |
| 275 Click <b>OK</b>. | |
| 276 The packager creates two files: | |
| 277 a <code>.crx</code> file, | |
| 278 which is the actual extension that can be installed, | |
| 279 and a <code>.pem</code> file, | |
| 280 which contains the private key. | |
| 281 </li> | |
| 282 </ol> | |
| 283 <p> | |
| 284 <b>Do not lose the private key!</b> | |
| 285 Keep the <code>.pem</code> file secret and in a safe place. | |
| 286 You'll need it later if you want to do any of the following: | |
| 287 </p> | |
| 288 <ul> | |
| 289 <li><a href="#update">Update</a> the extension</li> | |
| 290 <li><a href="#upload">Upload</a> the extension to the Chrome Web Store</li> | |
| 291 </ul> | |
| 292 <p> | |
| 293 If the extension is successfully packaged, you'll see a dialog like this | |
| 294 that tells you where to find | |
| 295 the <code>.crx</code> and <code>.pem</code> files:</p> | |
| 296 <p></p> | |
| 297 <img src="images/package-success.gif" width="554" height="208"> | |
| 298 <h2 id="update">Updating a package</h2> | |
| 299 <p>To create an updated version of your extension:</p> | |
| 300 <ol> | |
| 301 <li> | |
| 302 Increase the version number in <code>manifest.json</code>. | |
| 303 </li> | |
| 304 <li> | |
| 305 Bring up the Extensions management page | |
| 306 by going to this URL: <b>chrome://extensions</b> | |
| 307 </li> | |
| 308 <li> | |
| 309 Click the <b>Pack extension</b> button. | |
| 310 A dialog appears. | |
| 311 </li> | |
| 312 <li> | |
| 313 In the <b>Extension root directory</b> field, | |
| 314 specify the path to the extension's folder—for example, | |
| 315 <code>c:\myext</code>. | |
| 316 </li> | |
| 317 <li> | |
| 318 In the <b>Private key file</b> field, | |
| 319 specify the location of the | |
| 320 already generated <code>.pem</code> file for this extension—for | |
| 321 example, <code>c:\myext.pem</code>. | |
| 322 </li> | |
| 323 <li> | |
| 324 Click <b>OK</b>. | |
| 325 </li> | |
| 326 </ol> | |
| 327 <p>If the updated extension is successfully packaged, you'll see a dialog like t
his:</p> | |
| 328 <img src="images/update-success.gif" width="298" height="160"> | |
| 329 <h2 id="upload"> Uploading a previously packaged extension to the Chrome Web Sto
re</h2> | |
| 330 <p> | |
| 331 You can use the Chrome Developer Dashboard | |
| 332 to upload an extension that you've previously packaged yourself. | |
| 333 However, unless you take special steps, | |
| 334 the extension's ID in the Chrome Web Store | |
| 335 will be different from its ID in the package you created. | |
| 336 This different ID might be a problem if you've | |
| 337 distributed your extension package, | |
| 338 because it allows users to install multiple versions of your extension, | |
| 339 each with its own local data. | |
| 340 </p> | |
| 341 <p> | |
| 342 If you want to keep the extension ID the same, | |
| 343 follow these steps: | |
| 344 </p> | |
| 345 <ol> | |
| 346 <li> Rename the private key that was generated | |
| 347 when you created the <code>.crx</code> file to <code>key.pem</code>. </li> | |
| 348 <li> Put <code>key.pem</code> in the top directory | |
| 349 of your extension. </li> | |
| 350 <li> Compress that directory into a ZIP file. </li> | |
| 351 <li> Upload the ZIP file using the | |
| 352 <a href="https://chrome.google.com/webstore/developer/dashboard">Chrome Deve
loper Dashboard</a>. </li> | |
| 353 </ol> | |
| 354 <a name="H2-3"></a><h2>Packaging at the command line</h2> | |
| 355 <p> | |
| 356 Another way to package extensions | |
| 357 is by invoking <code>chrome.exe</code> at the command line. | |
| 358 Use the <code>--pack-extension</code> flag | |
| 359 to specify the location of the extension's folder. | |
| 360 Use <code>--pack-extension-key</code> | |
| 361 to specify the location of the extension's private key file. | |
| 362 For example: | |
| 363 </p> | |
| 364 <pre>chrome.exe --pack-extension=c:\myext --pack-extension-key=c:\myext.pem | |
| 365 </pre> | |
| 366 <p> | |
| 367 To suppress the dialog, | |
| 368 add <code>--no-message-box</code> to the command. | |
| 369 </p> | |
| 370 <a name="H2-4"></a><h2>Package format and scripts</h2> | |
| 371 <p> | |
| 372 For more information on the format, as well as pointers to scripts you can use | |
| 373 to create <code>.crx</code> files, see <a href="crx.html">CRX Package Format</a>
. | |
| 374 </p> | |
| 375 </div> | |
| 376 <!-- API PAGE --> | |
| 377 <!-- /apiPage --> | |
| 378 </div> <!-- /gc-pagecontent --> | |
| 379 </div> <!-- /g-section --> | |
| 380 </div> <!-- /codesiteContent --> | |
| 381 <div id="gc-footer" --=""> | |
| 382 <div class="text"> | |
| 383 <p> | |
| 384 Except as otherwise <a href="http://code.google.com/policies.html#restrictions
">noted</a>, | |
| 385 the content of this page is licensed under the <a rel="license" href="http://c
reativecommons.org/licenses/by/3.0/">Creative Commons | |
| 386 Attribution 3.0 License</a>, and code samples are licensed under the | |
| 387 <a rel="license" href="http://code.google.com/google_bsd_license.html">BSD Lic
ense</a>. | |
| 388 </p> | |
| 389 <p> | |
| 390 ©2011 Google | |
| 391 </p> | |
| 392 <!-- begin analytics --> | |
| 393 <script src="https://www.google-analytics.com/urchin.js" type="text/javascript">
</script> | |
| 394 <script src="https://www.google-analytics.com/ga.js" type="text/javascript"></sc
ript> | |
| 395 <script type="text/javascript"> | |
| 396 // chrome doc tracking | |
| 397 try { | |
| 398 var engdocs = _gat._getTracker("YT-10763712-2"); | |
| 399 engdocs._trackPageview(); | |
| 400 } catch(err) {} | |
| 401 // code.google.com site-wide tracking | |
| 402 try { | |
| 403 _uacct="UA-18071-1"; | |
| 404 _uanchor=1; | |
| 405 _uff=0; | |
| 406 urchinTracker(); | |
| 407 } | |
| 408 catch(e) {/* urchinTracker not available. */} | |
| 409 </script> | |
| 410 <!-- end analytics --> | |
| 411 </div> | |
| 412 </div> <!-- /gc-footer --> | |
| 413 </div> <!-- /gc-container --> | |
| 414 </body></html> | |
| OLD | NEW |