Usually, users install their own extensions. But sometimes you might want an extension to be installed automatically. Here are two typical cases:
An extension that's installed automatically is known as an external extension. Google Chrome supports two ways of installing external extensions:
Both ways support installing an extension hosted at an
update_URL.
In the Windows registry,
the update_URL must point to the Chrome Web Store
where the extension is hosted.
In the preferences file,
it can point to your own server where you are hosting the extension
(see autoupdating).
The preferences JSON file also supports installing
an extension from a .crx extension
file on the user's computer
(see hosting).
Install extensions from your website: The safest option for your users is to publish your extension in the Chrome Web Store. Instead of hosting your own extension, publish it in the store, and link to the store install using inline installation.
First, publish
the extension in the Chrome Web Store,
or package a .crx file
and make sure that it installs successfully.
Windows installs must come from Chrome Web Store:
As of Chrome 33,
no external installs are allowed from a path to a local .crx
(see Protecting Windows users from malicious extensions).
If installing from an update URL, ensure that the extension is properly hosted.
Before you edit the preferences file or the registry, make a note of the following:
.crx file,
or the update URL from which it is served
The following examples assume the version is 1.0
and the ID is aaaaaaaaaabbbbbbbbbbcccccccccc.
Mac OS X and Linux only: Do not use the preferences file for Windows. Use Windows registry instead.
.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 for example,
\\server\share\extension.crx
or /home/share/extension.crx.)
aaaaaaaaaabbbbbbbbbbcccccccccc.json where the file name (without the extension)
corresponds to your extension's ID.
The location depends on the operating system.
~USERNAME/Library/Application Support/Google/Chrome/External Extensions//Library/Application Support/Google/Chrome/External Extensions/
The external extension file for all users is read only if every directory in the path is owned by the user root, has the group admin or wheel, and is not world writable. The path must also be free of symbolic links. These restrictions prevent an unprivileged user from causing extensions to be installed for all users. See troubleshooting for details.
Note: The above path for all users was added in Chrome 16. Prior versions used a different path:
/Applications/Google Chrome.app/Contents/Extensions/
This path was deprecated in version 17. Support was removed in version 20. Use one of the paths above instead.
/opt/google/chrome/extensions/ /usr/share/google-chrome/extensions/ chmod if necessary
to make sure that the aaaaaaaaaabbbbbbbbbbcccccccccc.json files
are world-readable.
Example:
{
"external_crx": "/home/share/extension.crx",
"external_version": "1.0"
}
Note:
You need to escape
each \ character in the location.
For example,
\\server\share\extension.crx would be
"\\\\server\\share\\extension.crx".
If you are installing from an update URL, specify the extension's update URL with field name "external_update_url".
Example:{
"external_update_url": "http://myhost.com/mytestextension/updates.xml"
}
If you would like to install extension only for some browser locales, you can list supported locales in field name "supported_locale". Locale may specify parent locale like "en", in this case the extension will be installed for all English locales like "en-US", "en-GB", etc. If another browser locale is selected that is not supported by the extension, the external extensions will be uninstalled. If "supported_locales" list is missing, the extension will be installed for any locale.
Example:{
"external_update_url": "http://myhost.com/mytestextension/updates.xml",
"supported_locales": [ "en", "fr", "de" ]
}
Note:
Previous versions of Google Chrome used an
external_extensions.json file to specify which extensions to
install. This file has been deprecated in favor of individual .json
files, one per extension.
On Mac OS, the external extensions files for all users are only read if file system permissions prevent unprivileged users from changing it. If you do not see external extensions installed when Chrome is launched, there may be a permissions problem with the external extensions preferences files. To see if this is the problem, follow these steps:
chgrp or the Finder's Get Info dialog to change the directory's group owner to the Administrator group.HKEY_LOCAL_MACHINE\Software\Google\Chrome\Extensions HKEY_LOCAL_MACHINE\Software\Wow6432Node\Google\Chrome\Extensions aaaaaaaaaabbbbbbbbbbcccccccccc).
{
"update_url": "https://clients2.google.com/service/update2/crx"
}
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.
To update your extension to a new version, update the file, and then update the version in the preferences or registry.
To uninstall your extension (for example, if your software is uninstalled), remove your preference file (aaaaaaaaaabbbbbbbbbbcccccccccc.json) or the metadata from the registry.
This section answers common questions about external extensions.
Will the methodology for allowing a “pre-install” still be supported by Google Chrome from M33 onwards?
Yes, but only as an install from a Chrome Web Store
update_URL,
not from a local file path.
Can I specify a URL as a path to the external extension?
Yes, use the preferences JSON file for Mac OS X and Linux; the registry for Windows. The extension must be hosted as explained in hosting. In the preferences file, use the "external_update_url" property to point to an update manifest that has the URL for your extension. In the Windows registry, use the "update_url" property.
What are some common mistakes when installing with the preferences file?
.crx aaaaaaaaaabbbbbbbbbbcccccccccc.json) is in
the wrong location or the ID specified does not match the extension ID.
.crx (or path specified but no filename) "\\server\share\file" is wrong;
it should be "\\\\server\\share\\extension") What are some common mistakes when installing with the registry?
.crx file in the Chrome Web StoreHow do I update my native binaries and extension in-step?
Previously when off-store extensions were supported, it was possible to have the native binaries and the extension be updated in lock step. However, extensions hosted on the Chrome Web Store are updated via the Chrome update mechanism which developers do not control. Extension developers should be careful about updating extensions that have a dependency on the native binary (for example, legacy extensions using NPAPI).
What if the user uninstalls the extension?
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.
How do I get off the blacklist?
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.