Skip to content
Adblock Plus for Chrome source code
JavaScript HTML Python CSS
Failed to load latest commit information.
_locales Issue 3796 - Added preference to remove developer tools panel Mar 14, 2016
chrome Issue 3823 - Split up message responder code Mar 21, 2016
ext Issue 2426 - Open block element dialog as a popup window Feb 17, 2016
icons Issue 2086 - Update adblockplusui dependency to revision 457cd7815a8a Mar 4, 2015
jquery-ui Updated to jQuery 1.7.1 and jQuery UI 1.8.16 Jan 9, 2012
lib Issue 3870 - Rewrite legacy options page to use async messages Apr 7, 2016
qunit Issue 3826 - Filter preference change events Mar 17, 2016
safari Issue 3924 - Notice pages loaded from Safari's page cache Apr 14, 2016
skin Issue 2195 - Added notification opt-out (Platform) Jun 26, 2015
.gitignore Issue 3404 - Ignore the new devenv paths Jan 27, 2016
.hgignore Issue 3404 - Ignore the new devenv paths Jan 27, 2016
.hgtags Added tag 1.11 for changeset bd365839f4c9 Mar 8, 2016
COPYING Noissue - Added COPYING file Jun 15, 2015
README.md Issue 3760 - Merged Chrome and Opera builds Mar 8, 2016
background.js Issue 3870 - Rewrite legacy options page to use async messages Apr 7, 2016
build.py Issue 3952 - Fix whitespaces in build.py for compliance with PEP-8 Apr 18, 2016
composer.html Noissue - Rename blockElement.postload.js, block.html and block.js fo… Mar 16, 2016
composer.js Noissue - Rename blockElement.postload.js, block.html and block.js fo… Mar 16, 2016
composer.postload.js Noissue - Rename blockElement.postload.js, block.html and block.js fo… Mar 16, 2016
dependencies Issue 3952 - Updated buildtools dependency for whitespace changes Apr 18, 2016
ensure_dependencies.py Issue 3952 - Updated buildtools dependency for whitespace changes Apr 18, 2016
include.preload.js Issue 3860 - Move request blocking logic to a seperate module Mar 22, 2016
metadata.chrome Issue 2426 - Open block element dialog as a popup window Feb 17, 2016
metadata.common Issue 3868 - Use the new FilterNotifier API Mar 24, 2016
metadata.safari Issue 3616 - Turn popupBlocker.js into a module Feb 2, 2016
notification.js Noissue - Updated copyright year Jan 20, 2016
options.html Issue 3796 - Added preference to remove developer tools panel Mar 14, 2016
options.js Issue 3915 - Properly handle special subscriptions Apr 14, 2016
popup.html Noissue - Updated copyright year Jan 20, 2016
popup.js Issue 3842 - Split up the logic updating the icon and context menu Mar 19, 2016
stats.js Issue 3868 - Use the new FilterNotifier API Mar 24, 2016
subscriptionLink.postload.js Issue 3829 - Use subscriptions.add instead add-subscriptions Mar 17, 2016
utils.js Added Safari support. Nov 2, 2013

README.md

Adblock Plus for Chrome, Opera and Safari

This repository contains the platform-specific Adblock Plus source code for Chrome, Opera and Safari. It can be used to build Adblock Plus for these platforms, generic Adblock Plus 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 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, 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 safari devenv

This will create a devenv.platform directory in the repository. In Chrome you should load devenv.chrome 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.safari/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.

Something went wrong with that request. Please try again.