Edge and Chrome do not allow user to manually install an extension outside the Edge/Chrome Web Store by default. This article will introduce how to deploy a self-hosting Edge/Chrome extension to Microsoft Edge browser including allowing user to manually install an external extension and forcing an external extension to be installed silently in Edge.
Prerequisites
I assume you already developed the Edge/Chrome extension and hosted it somewhere. For how to develop a browser extension, you may start from here. This article will use following sample extension that I already deployed to a public web server:
- Extension name: Sheng's browser extension
- Extension ID: dcammpemjaodphbdhpcmlfhbgkhagalj
- CRX install link: https://lab.eastasia.cloudapp.azure.com/cases/extension/sheng-s-browser-extension.crx
- Update file: https://lab.eastasia.cloudapp.azure.com/cases/extension/updates.xml
Force installs the extension using the ExtensionInstallForcelist
setting
After configuring policy setting: Control which extensions are installed silently to following value, the sample extension will be automatically installed in Edge.
dcammpemjaodphbdhpcmlfhbgkhagalj;https://lab.eastasia.cloudapp.azure.com/cases/extension/updates.xml
The registry key behind this setting is:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\ExtensionInstallForcelist]
"1"="dcammpemjaodphbdhpcmlfhbgkhagalj;https://lab.eastasia.cloudapp.azure.com/cases/extension/updates.xml"
Allow manual installation using the ExtensionInstallSources
and ExtensionInstallAllowlist
settings
Enable Configure extension and user script install sources and add entry:
*://lab.eastasia.cloudapp.azure.com/*
to the list.NOTE: Both the location of the
*.crx
file and the page where the download is started from (the referrer) should be added to the list. In this case, the page that initiates the CRX file download is https://lab.eastasia.cloudapp.azure.com/cases/extension/readme.html, so I just need to add*://lab.eastasia.cloudapp.azure.com/*
to the list because the*.crx
file is hosted on the same domain. If user needs to install this extension from https://edgedbg.com/cases/extension/readme.html, then*://edgedbg.com/*
also needs to be added to the list.Enable Allow specific extensions to be installed and add extension ID:
dcammpemjaodphbdhpcmlfhbgkhagalj
to the list.After the setting is applied, user can visit the extension installation page: https://lab.eastasia.cloudapp.azure.com/cases/extension/readme.html and click the CRX file link to install the extension.
The registry keys behind those two settings are:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge]
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\ExtensionInstallAllowlist]
"1"="dcammpemjaodphbdhpcmlfhbgkhagalj"
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\ExtensionInstallSources]
"1"="*://lab.eastasia.cloudapp.azure.com/*"
Force/Manual installs the extension using the ExtensionSettings
setting
ExtensionSettings accepts one line JSON string as input, see detailed usage from: A detailed guide to configuring extensions using the ExtensionSettings policy
Following JSON force installs the sample extension.
{
"*": {
"install_sources": ["*://lab.eastasia.cloudapp.azure.com/*"]
},
"dcammpemjaodphbdhpcmlfhbgkhagalj": {
"installation_mode": "force_installed",
"update_url": "https://lab.eastasia.cloudapp.azure.com/cases/extension/updates.xml"
}
}
Minified:
{"*":{"install_sources":["*://lab.eastasia.cloudapp.azure.com/*"]},"dcammpemjaodphbdhpcmlfhbgkhagalj":{"installation_mode":"force_installed","update_url":"https://lab.eastasia.cloudapp.azure.com/cases/extension/updates.xml"}}
Registry key:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge]
"ExtensionSettings"="{\"*\":{\"install_sources\":[\"*://lab.eastasia.cloudapp.azure.com/*\"]},\"dcammpemjaodphbdhpcmlfhbgkhagalj\":{\"installation_mode\":\"force_installed\",\"update_url\":\"https://lab.eastasia.cloudapp.azure.com/cases/extension/updates.xml\"}}"
NOTE
- Same as the
ExtensionInstallSources
setting, both the location of the*.crx
file and the page where the download is started from (the referrer) should be added to theinstall_sources
list. - If you want to allow manual installation, change the
installation_mode
toallowed
.