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_LOCATION
environment variable is set to the root of yourmozilla-central
checkout. - Depending on where you want to export to, run one of the following:
- For exporting into
mozilla-central
into both the Desktop build and the Android Components, runnpm run jake export
. - For exporting into the Desktop tree of
mozilla-central
, runnpm run jake export-mc
. - For exporting into the Android Components tree of
mozilla-central
, runnpm run jake export-ac
.
- For exporting into
- Your changes will now be in your
mozilla-central
checkout. 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:config
in Firefox - Set
extensions.experiments.enabled
pref totrue
- Open
about:debugging
- Click the
Load Temporary Add-on...
button - Select
./src/manifest.json
and 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
.xpi
inside 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-central
as explained above. - Switch into your
mozilla-central
directory. - 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.