summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/docs/static/external_extensions.html
blob: 37dddb50e7f7f692726f7108ad3aef73b7e29645 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<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.