blob: 76a11756e534cfd479e67c4db5124937de3423ff [file] [log] [blame] [view]
avm99963ea37fdf2021-02-03 01:27:13 +01001# Build the extension
2A zip file with the contents of the extension, which can be uploaded to the
3Chrome Web Store and addons.mozilla.org, can be created with any of the
4following procedures (make sure to [install Go](https://golang.org) before
5building the extension, as it is needed during the build):
6
7## Using the release.bash script
8Run `bash release.bash -h` in order to learn how to use this command. To
9summarize, the command accepts the `--channel` and `--browser` flags (or their
10short versions `-c` and `-b`).
11
12As an example, if you wanted to create a ZIP file of the beta-branded extension
13targeted for Firefox, you would run `bash release.bash -c beta -b gecko`.
14
15## Using make
16You can also use _make_ to build the extension. This is just a wrapper for the
17`release.bash` command.
18
19Run `make all` to build the extension for all the available channels and
20browsers. You can also run `make {target}` where `{target}` is one of the
21following: `chromium-stable`, `chromium-beta`, `chromium-mv3-beta`,
22`gecko-stable`.
23
24Run `make clean` to clean all the release files (this removes the `out` folder,
25which is where the release files are saved).
26
27## Load the extension "without" building it
28If you're developing the extension, you might want to load it into your browser
29without having to constantly build it after each change. In order to do that,
30you'll only have to manually generate the manifest each time you change the
31`template/manifest.gjson` file (or only once if you don't change it, and once
32every time you pull new changes to your git clone).
33
34In order to do that, run `go run generateManifest.go {browser}`, where
35`{browser}` is `CHROMIUM`, `GECKO` or `CHROMIUM_MV3`, and this will generate the
36`manifest.json` file for the specified browser in the `src` directory. Now, you
37can load the `src` folder directly in the browser in order to import the
38extension.
39
40## About the _Chromium MV3_ target
41Chromium is working in a
42[new version of the manifest.json file](https://developer.chrome.com/docs/extensions/mv3/intro/),
43which also introduces some changes to the extension APIs. Eventually, all Chrome
44extensions will be required to have migrated to Manifest V3 (MV3), so in order
45to anticipate this change, a new experimental _Chromium MV3_ target has been
46added.
47
48This target is experimental in the sense that it isn't actually used when
49building the extension ZIPs which are uploaded to the Chrome Web Store (MV2 is
50still used), and because these builds aren't currently being exhaustively
51tested.