How to deploy a self-hosting browser extension to Microsoft Edge
May 26, 2022

Edge and Chrome do not allow users to install extensions outside of the Edge/Chrome Web Store by default. This article will introduce how to deploy a self-hosting Edge/Chrome extension to the Microsoft Edge browser, including allowing users to install external extensions manually and silently installing external extensions in Edge.

Prerequisites

It is assumed that you have already developed the Edge/Chrome extension and hosted it somewhere. For guidance on how to develop a browser extension, you can start here. This article will use the following sample extension that I have already deployed to a public web server:

Force installs the extension using the ExtensionInstallForcelist setting

After configuring the policy setting: Control which extensions are installed silently to the 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

  1. 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 only *://lab.eastasia.cloudapp.azure.com/* needs to be added to the list because the .crx file is hosted on the same domain. If the extension needs to be installed from https://edgedbg.com/cases/extension/readme.html, then *://edgedbg.com/* also needs to be added to the list.

  2. Enable Allow specific extensions to be installed and add the extension ID: dcammpemjaodphbdhpcmlfhbgkhagalj to the list.

  3. After these settings are 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 a single line JSON string as input. You can find detailed usage instructions in the article: A detailed guide to configuring extensions using the ExtensionSettings policy

The following JSON will force install 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

  1. 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 the install_sources list.
  2. If you want to allow manual installation, change the installation_mode to allowed.

Categories

Microsoft Edge