adblockplus

Shared Adblock Plus UI code

The user interface elements defined in this repository will be used by various Adblock Plus products like Adblock Plus for Firefox. Their functionality can be tested within this repository, even though they might not work exactly the same as they will do in the final product.

Installing dependencies

Both python 2 and node, as well as npm, are required to contribute to this repository.

If you are installing node in ArchLinux, please remember to install npm too.

After cloning this repository, enter into its folder and run: npm install.

This should create and populate, both ./node_modules folder and the ./buildtools one.

Directory structure

Testing

In Firefox the HTML pages can be opened directly from the file system and should be fully functional. Due to security restrictions in Chrome, there you need to pass in the --allow-file-access-from-files command line flag when starting the application. Alternatively, you can run npm start and open the HTML pages under URL shown shown in the terminal (example: http://127.0.0.1:8080).

You can pass along to underlying http-server program any arguments via -- as in:

npm start -- -p 5000 -c-1

Various aspects of the pages can be tested by setting parameters in the URL. The only universal parameter is locale, e.g. ?locale=es-AR. This parameter overrides browser’s locale which will be used by default.

Linting

You can lint all options via npm run lint.

You can also run specific target linting via npm run lint:js or, once available, via npm run lint:css.

Remember, both eslint and stylelint can help fixing issues via --fix flag.

You can try as example via npx which should be provided automatically when you install npm.

npx stylelint --fix skin/real-file-name.css

Translations

Translations for the strings in this project are managed using the online Crowdin platform. To synchronise with Crowdin you can use the build script. To get a list of the possible commands type ./build.py help at the command line. (You will also need the Crowdin API key for the project.)

firstRun.html

This is the implementation of the Adblock Plus first-run page that will show up whenever changes are applied automatically to user’s Adblock Plus configuration. This will usually happen when the user first installs Adblock Plus (initial setup), but it can also happen in case the user’s settings get lost.

To aid testing, the behavior of this page is affected by a number of URL parameters:

mobile-options.html

This is a web extension implementation of the Adblock Plus for Firefox Mobile options page.

To aid testing, the behavior of this page is affected by a number of URL parameters:

desktop-options.html

This is the implementation of the Adblock Plus options page which is the primary UI for changing settings and for managing filter lists.

To aid testing, the behavior of this page is affected by a number of URL parameters: