and Distribution - screenly/chrome-extension

To package and distribute the Chrome extension from the provided GitHub repository (https://github.com/screenly/chrome-extension/), follow these steps:

  1. Prepare the extension for packaging

Make sure you have the necessary files for the extension. In the provided repository, you will find the following files and directories:

  • manifest.json: This file contains the basic information about the extension.
  • src: This directory contains the source code of the extension.
  • package.json: This file includes the dependencies and scripts for building the extension.
  1. Build the extension

The project already includes a build script using webpack. To build the extension, run the following command:

npm run build

This command generates the compiled and minified files in the dist directory.

  1. Create the extension package

After building the extension, you need to create a .crx file, which is the packaged format for Chrome extensions. Run the following command:

chromium-browser --pack-extension=dist

This command generates a .crx file and a .pem file in the dist directory. The .crx file is the packaged extension you need to distribute.

  1. Distribution options

You have two options for distributing the extension:

  • Docker Desktop Extensions Marketplace: Docker Desktop allows you to publish your Chrome extension in their marketplace. This option is recommended if you want to reach a larger audience. To publish your extension, follow the instructions in the Docker documentation.

  • Manual distribution: You can also distribute the extension manually by providing the .crx file to users. Users can then install the extension manually by dragging the .crx file into the Chrome Extensions page (chrome://extensions).

  1. Updating the extension

If you need to update the extension, increment the version number in the manifest.json file and repeat the packaging and distribution steps. Users can update the extension by dragging the new .crx file into the Chrome Extensions page.

Quoted sources: