Adblock Plus for Chrome source code
JavaScript HTML Python CSS
Pull request Compare This branch is 15 commits ahead, 495 commits behind adblockplus:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
_locales
chrome
ext
icons
jquery-ui
lib
qunit
safari
skin
.gitignore
.hgignore
.hgtags
COPYING
README.md
background.js
block.html
block.js
build.py
dependencies
ensure_dependencies.py
include.postload.js
include.preload.js
metadata.chrome
metadata.common
metadata.opera
metadata.safari
notification.js
options.html
options.js
popup.html
popup.js
popupBlocker.js
stats.js
utils.js
webrequest.js

README.md

Ad Blocking Community for Chrome, Opera and Safari

This repository contains the platform-specific Ad Blocking Community source code for Chrome, Opera and Safari. It can be used to build Ad Blocking Community for these platforms, generic Ad Blocking Community code will be extracted from other repositories automatically (see dependencies file).

Building

Requirements

Building the extension

Run one of the following commands in the project directory, depending on your target platform:

./build.py -t chrome build -k adblockpluschrome.pem
./build.py -t opera build -k adblockplusopera.pem
./build.py -t safari build -k adblockplussafari.pem

This will create a build with a name in the form adblockpluschrome-1.2.3.nnnn.crx or adblockplussafari-1.2.3.nnnn.safariextz. Note that you don't need an existing signing key for Chrome or Opera, a new key will be created automatically if the file doesn't exist. Safari on the other hand always requires a valid developer certificate, you need to get one in the Apple Developer Center first. adblockplussafari.pem should contain the private key for your developer certificate, the developer certificate itself as well as all the certificates it was signed with (Apple's root certificate and intermediate certificates) in PEM format - in that order.

Development environment

To simplify the process of testing your changes you can create an unpacked development environment. For that run one of the following commands:

./build.py -t chrome devenv
./build.py -t opera devenv
./build.py -t safari devenv

This will create a devenv directory in the repository. In Chrome and Opera you should load it as an unpacked extension directory. After making changes to the source code re-run the command to update the development environment, the extension should reload automatically after a few seconds.

In Safari you should load devenv/adblockplussafari.safariextension as unpacked extension directory. After making changes to the source code re-run the command to update the development environment. You will still need to reload the extension explicitly in the Extension Builder, Safari currently doesn't allow automating this action.

Running the unit tests

To verify your changes you can use the unit test suite located in the qunit directory of the repository. In order to run the unit tests go to the extension's Options page, open the JavaScript Console and type in:

location.href = "qunit/index.html";

The unit tests will run automatically once the page loads.