Install Chrome extension form outside the Chrome Web Store

前端 未结 2 1883
青春惊慌失措
青春惊慌失措 2021-01-31 02:01

I have developed a Chrome extension and I have packed it.
I sent my extension to some people to try it, but Chrome started to block extensions that it does not find in the s

相关标签:
2条回答
  • 2021-01-31 02:42

    For regular Windows users who are not skilled with computers, it is practically not possible to install and use extensions from outside the Chrome Web Store.

    Users of other operating systems (Linux, Mac, Chrome OS) can easily install unpacked extensions (in developer mode).
    Windows users can also load an unpacked extension, but they will always see an information bubble with "Disable developer mode extensions" when they start Chrome or open a new incognito window, which is really annoying. The only way for Windows users to use unpacked extensions without such dialogs is to switch to Chrome on the developer channel, by installing https://www.google.com/chrome/browser/index.html?extra=devchannel#eula.

    Extensions can be loaded in unpacked mode by following the following steps:

    1. Visit chrome://extensions (via omnibox or menu -> Tools -> Extensions).
    2. Enable Developer mode by ticking the checkbox in the upper-right corner.
    3. Click on the "Load unpacked extension..." button.
    4. Select the directory containing your unpacked extension.

    If you have a crx file, then it needs to be extracted first. CRX files are zip files with a different header. Any capable zip program should be able to open it. If you don't have such a program, I recommend 7-zip.

    These steps will work for almost every extension, except extensions that rely on their extension ID. If you use the previous method, you will get an extension with a random extension ID. If it is important to preserve the extension ID, then you need to know the public key of your CRX file and insert this in your manifest.json. I have previously given a detailed explanation on how to get and use this key at https://stackoverflow.com/a/21500707.

    0 讨论(0)
  • 2021-01-31 02:58

    For Windows, you can also whitelist your extension through Windows policies. The full steps are details in this answer, but there are quicker steps:

    1. Create the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\ExtensionInstallWhitelist.
    2. For each extension you want to whitelist, add a string value whose name should be a sequence number (starting at 1) and value is the extension ID.

    For instance, in order to whitelist 2 extensions with ID aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa and bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, create a string value with name 1 and value aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, and a second value with name 2 and value bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb. This can be sum up by this registry file:

    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome]
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\ExtensionInstallWhitelist]
    "1"="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
    "2"="bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
    

    EDIT: actually, Chromium docs also indicate how to do it for other OS.

    0 讨论(0)
提交回复
热议问题