Getting the source code
The Adblock Plus source code can viewed throught the HG web interface. A local copy may be downloaded by running the following from the command line:
hg clone https://hg.adblockplus.org/adblockplus/
hg up -r 1.0.1
1.0.1 with the tag of the required version).
Alternatively, you can also download the source code of the latest release.
The Adblock Plus source code documentation provides an overview of the add-on internals.
HG client and documentation links
- Mercurial (quickstart)
- Mozilla's Mercurial FAQ
- Distributed Revision Control with Mercurial (hgbook)
- GUI clients and other tools
Creating an Adblock Plus build
A development build may be created by entering the "adblockplus" directory (your local copy of the repository) and running the command:
python build.py build
The script will create a development build with a name in the form adblockplus-184.108.40.206+.nnnn.xpi. This file will contain the source code currently in the repository and all available locales.
Testing your changes
To simplify the process of testing your changes you can install Extension Auto-Installer in your browser. Assuming that Extension Auto-Installer is configured to use port 8888 (the default value), you can push your changes to this browser by running:
python build.py autoinstall 8888
The browser will be restarted automatically if necessary.
Running unit tests
To verify your changes you can use the existing
unit test suite. The
unit tests are a separate extension that is installed in addition to Adblock
Plus. You can either install the
existing unit test builds
or clone the repository and create your own build. After installing the unit tests
chrome://adblockplustests/content/index.html to run the tests.