blob: 9fe8e75eb0067aadfe74f028d1ff9f607cae5ad7 [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
Adrià Vilanova Martínez3465e772021-07-11 19:18:41 +02003Chrome Web Store and addons.mozilla.org, can be created by following these
4instructions. (make sure to [install Go](https://golang.org) before building the
5extension, as it is needed during the build).
avm99963ea37fdf2021-02-03 01:27:13 +01006
Adrià Vilanova Martínez3465e772021-07-11 19:18:41 +02007The last section explains how to build the extension automatically when you
8change the source code.
avm99963ea37fdf2021-02-03 01:27:13 +01009
Adrià Vilanova Martínez3465e772021-07-11 19:18:41 +020010## Build the extension as a zip file
11Run `make release` to build the extension for all the available channels and
avm99963ea37fdf2021-02-03 01:27:13 +010012browsers. You can also run `make {target}` where `{target}` is one of the
Adrià Vilanova Martínez3465e772021-07-11 19:18:41 +020013following: `release_chromium_stable`, `release_chromium_beta`,
14`release_gecko_stable`.
avm99963ea37fdf2021-02-03 01:27:13 +010015
Adrià Vilanova Martínez3465e772021-07-11 19:18:41 +020016Run `make clean_releases` to clean all the release files (this removes the `out`
17folder, which is where the release files are saved).
avm99963ea37fdf2021-02-03 01:27:13 +010018
Adrià Vilanova Martínez3465e772021-07-11 19:18:41 +020019Take a look at `Makefile`, you'll find other targets for _make_ which do other
20interesting things (like `clean`, for instance).
21
22## Build the extension continously with webpack development mode
avm99963ea37fdf2021-02-03 01:27:13 +010023If you're developing the extension, you might want to load it into your browser
Adrià Vilanova Martínez3465e772021-07-11 19:18:41 +020024without having to constantly build it manually after each change. In order to do
25that, you can run `make serve_chromium`, `make serve_chromium_mv3` or
26`make serve_gecko` depending on the type of continuous build you want.
avm99963ea37fdf2021-02-03 01:27:13 +010027
Adrià Vilanova Martínez3465e772021-07-11 19:18:41 +020028This will run webpack with watch mode and continuously serve a fresh version of
29the compiled extension at `dist/{BROWSER}`, where `{BROWSER}` depends on the
30target you selected for _make_. You can load this folder in Chrome by going to
31`chrome://extensions` and selecting "Load unpacked".
32
33Keep in mind that while the extension is continuously built, it is not
34automatically being loaded into Chrome. You'll have to reload the extension
35manually in Chrome (but at least you won't have to both build and reload it).
avm99963ea37fdf2021-02-03 01:27:13 +010036
37## About the _Chromium MV3_ target
38Chromium is working in a
39[new version of the manifest.json file](https://developer.chrome.com/docs/extensions/mv3/intro/),
40which also introduces some changes to the extension APIs. Eventually, all Chrome
41extensions will be required to have migrated to Manifest V3 (MV3), so in order
42to anticipate this change, a new experimental _Chromium MV3_ target has been
43added.
44
45This target is experimental in the sense that it isn't actually used when
46building the extension ZIPs which are uploaded to the Chrome Web Store (MV2 is
47still used), and because these builds aren't currently being exhaustively
48tested.