Best Practices for Developing and Distributing Chrome Extensions in The Scoped Area
Develop
1. Move your dev actions to Github
This is the prerequisites, we’ll use the raw file serve and release feature of github later.
2. Setup update_url
Add updates.xml
to your codebase.
<?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<app appid='<extension id>'>
<updatecheck codebase='https://github.com/<username>/<reponame>/releases/download/v1.0.0/<extension name>.crx' version='1.0.0' />
</app>
</gupdate>
Use your extension id and other info replace the requirement fields.
Now, update update_url
in manifest.json
to https://raw.githubusercontent.com/<username>/<reponame>/main/updates.xml
.
3. Commit and Push your release
Before you really release extension, you should modify the version number in the manifest.json
.
4. Release on Github
- open
chrome://extensions/
- click
package the extension
button to generateextension.crx
- go to
https://github.com/<username>/<reponame>/releases/new
page - make a new tag and upload your crx file
- publish
5. Notify updates
After you release the new version, the last step is notify old extension to upgrade.
Update the version info in updates.xml
, commit and push to github.
Distribute
Initial Install
- enable flag
chrome://flags/#extensions-on-chrome-urls
- enable developer mode
chrome://extensions/
- drag crx file to
chrome://extensions/
page - [optional]disable flag
chrome://flags/#extensions-on-chrome-urls
- [optional]disable developer mode
chrome://extensions/
Upgrade
Chrome will auto upgrade your extension, you can manually do check in developer mode chrome://extensions/
Policy Notes
If Chrome limit or warning user to run your extension, you should update chrome://policy/ to add extension to ExtensionInstallAllowlist
.
More policy please check official documents.