The primary source code location for the WebCompat Interventions System Addon is now in-tree at browser/extensions/webcompat. This repo will stick around for prosperity, but it will remain archived unless we have a need for this to be updated.
This is the development repository for the Firefox WebCompat Go Faster add-on.
Detailed information on our policies on writing overrides, as well as technical information, can be found in the Mozilla Wiki.
This guide assumes you've got a copy of mozilla-central checked out on your machine and you already have set up Node.js 5 or newer. The build script assumes your mozilla-central is located at ../fx-team relative to inside the root folder. If not, please set the EXPORT_MC_LOCATION environment accordingly.
Running the extension without a built and set up mozilla-central is not possible at the moment.
If this is the first time you're working with this repository, install the dependencies with npm install.
- Ensure the version number is bumped in
src/manifest.json, appropriately (see Versioning Scheme for more info). - Make sure the
EXPORT_MC_LOCATIONenvironment variable is set to the root of yourmozilla-centralcheckout. - Run
npm run jake exportto export the sources. - Your changes will now be in your
mozilla-centralcheckout. Double-check the results, and you're ready to commit.
If you want to debug this extension on recent Desktop versions, you can use about:debugging:
- Open
about:configin Firefox - Set
extensions.experiments.enabledpref totrue - Open
about:debugging - Click the
Load Temporary Add-on...button - Select
./src/manifest.jsonand hit open. - Test!
Since the WebCompat feature inside Fenix is not shipped directly to the product but is included via a universal android component, you need both a local copy of Fenix and a local copy of Android-Components on your system. To build, make sure to follow the Mozilla Android Components' instructions on how to test unreleased component code, and use the android-component exporter (see above) to get your sources into the repo.
- Run
npm run build. - Find the built
.xpiinside theweb-ext-artifacts/directory.
- Run
npm run test - Wait!
Tests located in src/tests/ are not automatically started by the CI in this repo, but are meant as in-tree tests that run together with other Firefox tests. These tests are triggered when trying to land things via Phabricator, but manually running them is also possible.
- Export the sources to
mozilla-centralas explained above. - Switch into your
mozilla-centraldirectory. - Build the changed sources into Firefox by running
./mach build. - Run the test suite with
./mach mochitest browser/extensions/webcompat/.
As mozilla-central is now mostly auto-formatted with prettier, and the config for that is really slim, this repo follows these guidelines. To automatically check and adjust the code style,
- Run
npm run autoformat - Done.
If you want to make sure you don't push something that would fail on CI, use the pre-push hook supplied with this repository.
If your Git version is newer than 2.9.x, you can enable the hooks with
git config core.hooksPath .githooks
and if Git is older, please symlink the hook into the right directory manually with
ln -s .githooks/pre-push .git/hooks/
MPL.