| <div id="pageData-name" class="pageData">External Extensions</div> |
| <div id="pageData-showTOC" class="pageData">true</div> |
| |
| <p> |
| Google Chrome implements a mechanism |
| to detect when an external extension |
| needs to be installed. |
| Typically, this could be leveraged |
| by 3rd party vendors |
| to install an extension whenever |
| the user installs their software. |
| Another use case includes network admins, |
| who want to install the same extensions |
| throughout their company. |
| |
| <p> |
| Google Chrome supports two ways of |
| installing external extensions: |
| using a preferences JSON file, |
| or using the Windows registry |
| (Windows only). |
| |
| <p> |
| <b>Important:</b> Before you begin, |
| make sure you have a <a href="packaging.html">packaged |
| crx file</a> that installs successfully, |
| and make a note of both the version |
| of the extension and its id (see chrome://extensions/). |
| For the rest of this text, we'll assume |
| the extension version is |
| <code>1.0</code> and its id is <code>aaaaaaaaaabbbbbbbbbbcccccccccc</code>. |
| |
| <h2 id="preferences">Using the Preferences File</h2> |
| |
| <ol> |
| <li>Make the .crx extension file available |
| to the machine you want to install the extension |
| on (copy it to a local directory |
| or to a network share, ie. <code>\\server\share\extension.crx</code>). |
| <li>Locate the external_extensions.json file under the Chrome |
| installation directory and add the following key inside |
| the curly brackets (note the extra escaping for the slashes, |
| which is also required when specifying local directories): |
| <pre>{ |
| "aaaaaaaaaabbbbbbbbbbcccccccccc": { |
| "external_crx": "\\\\server\\share\\extension.crx", |
| "external_version": "1.0" |
| } |
| }</pre> |
| <li>Save the json file. |
| <li>Launch Chrome and go to chrome://extensions |
| and you should see the extension listed. |
| </ol> |
| |
| |
| <h2 id="registry">Using the Windows Registry</h2> |
| |
| <ol> |
| <li>Make the .crx extension file available |
| to the machine you want to install the extension on |
| (copy it to a local directory or to a network share, |
| ie. <code>\\server\share\extension.crx</code>). |
| <li>Find (or create the following key) in the |
| registry:<br> |
| 32 bit Windows: <code>HKEY_LOCAL_MACHINE\Software\Google\Chrome\Extensions</code><br> |
| 64 bit Windows: <code>HKEY_LOCAL_MACHINE\Software\Wow6432Node\Google\Chrome\Extensions</code> |
| <li>Create a new key (folder) |
| under the Extensions key with the |
| same name as the id of your extension (<code>aaaaaaaaaabbbbbbbbbbcccccccccc</code>). |
| <li>Create two string values (<code>REG_SZ</code>):<br> |
| path: <code>\\server\share\extension.crx</code><br> |
| version: <code>1.0</code> |
| <li>Launch the browser and go to |
| chrome://extensions and you should |
| see the extension listed. |
| </ol> |
| |
| <h2 id="updating">Updating and Uninstalling</h2> |
| |
| <p>Google Chrome scans the metadata entries |
| in the preferences and registry |
| each time the browser starts, and makes |
| any necessary changes to the installed |
| external extensions. |
| |
| <p>To update your extension to a new version, |
| update the file, and then update the version |
| in the preferences or registry. |
| |
| <p>To uninstall your extension |
| (eg if your software is uninstalled), |
| remove the metadata from the preferences file |
| or registry. |
| |
| <h2 id="faq">FAQ</h2> |
| |
| <p><b>Can I specify a URL as a path to the external extension?</b> |
| <p>Not at this time. |
| Chrome only supports absolute/relative local paths |
| and UNC paths. |
| Relative paths are relative |
| to the Extensions directory |
| (where the external_extensions.json file is located). |
| <br> |
| <br> |
| |
| <p><b>What are some common mistakes when installing with the preferences file?</b> |
| <ul> |
| <li>Not specifying the same id/version |
| as the one listed in the .crx |
| <li>external_extension.json is not in the right location |
| <li>Syntax error in json file |
| (forgetting to separate entries with comma or |
| leaving a trailing comma somewhere) |
| <li>Extra curly brackets around the top level dictionary |
| <li>JSON file entry points to the wrong path |
| to the .crx (or path specified but no filename) |
| <li>Backslashes in UNC path not escaped (eg <code>\\server\share\file</code> (incorrect), instead of <code>\\\\server\\share\\extension</code> (correct) |
| <li>Permissions problems on a network share |
| </ul> |
| |
| <br> |
| |
| <p><b>What are some common mistakes when installing with the registry?</b> |
| <ul> |
| <li>Not specifying the same id/version as the one listed in the .crx |
| <li>Key created in the wrong location in the registry |
| <li>Registry entry points to the wrong path to the .crx (or path specified but no filename) |
| <li>Permissions problems on a network share |
| </ul> |
| |
| <br> |
| |
| <p><b>What if the user uninstalls the extension?</b> |
| <p>If the user uninstalls the extension through the UI, it will no |
| longer be installed or updated on each startup. In other words, the |
| external extension is blacklisted. |
| |
| <br><br> |
| |
| |
| <p><b>How do I get off the blacklist?</b> |
| <p>If the user uninstalls your extension, you should respect that |
| decision. However, if you (the developer) accidentally uninstalled |
| your extension through the UI, |
| you can remove the blacklist tag |
| by installing the extension normally |
| through the UI, and then uninstalling it. |