| Left: | ||
| Right: | 
| OLD | NEW | 
|---|---|
| 1 Adblock Plus for Chrome and Opera | 1 Adblock Plus for Chrome, Opera and Firefox | 
| 2 ================================= | 2 ========================================== | 
| 3 | 3 | 
| 4 This repository contains the platform-specific Adblock Plus source code for | 4 This repository contains the platform-specific Adblock Plus source code for | 
| 5 Chrome and Opera. It can be used to build Adblock Plus for these platforms, | 5 Chrome, Opera and Firefox. It can be used to build Adblock Plus for these | 
| 6 generic Adblock Plus code will be extracted from other repositories | 6 platforms, generic Adblock Plus code will be extracted from other repositories | 
| 7 automatically (see _dependencies_ file). | 7 automatically (see _dependencies_ file). | 
| 8 | 8 | 
| 9 Note that the Firefox extension built from this repository is the new | |
| 10 [WebExtension](https://developer.mozilla.org/en-US/Add-ons/WebExtensions). | |
| 11 The source code of the legacy Adblock Plus extension, based on the now | |
| 12 deprecated [Add-on SDK](https://developer.mozilla.org/en-US/Add-ons/SDK), | |
| 
 
Wladimir Palant
2017/06/07 19:54:07
It's not based on the Add-on SDK, it's rather a pl
 
Sebastian Noack
2017/06/08 13:37:00
Done.
 
 | |
| 13 can be found [here](https://hg.adblockplus.org/adblockplus). | |
| 14 | |
| 9 Building | 15 Building | 
| 10 --------- | 16 --------- | 
| 11 | 17 | 
| 12 ### Requirements | 18 ### Requirements | 
| 13 | 19 | 
| 14 - [Mercurial](https://www.mercurial-scm.org/) or [Git](https://git-scm.com/) (wh ichever you used to clone this repository) | 20 - [Mercurial](https://www.mercurial-scm.org/) or [Git](https://git-scm.com/) (wh ichever you used to clone this repository) | 
| 15 - [Python 2.7](https://www.python.org) | 21 - [Python 2.7](https://www.python.org) | 
| 16 - [The Jinja2 module](http://jinja.pocoo.org/docs) (>= 2.8) | 22 - [The Jinja2 module](http://jinja.pocoo.org/docs) (>= 2.8) | 
| 17 - [The PIL module](http://www.pythonware.com/products/pil/) | 23 - [The PIL module](http://www.pythonware.com/products/pil/) | 
| 18 - For signed builds: [PyCrypto module](https://www.dlitz.net/software/pycrypto/) | 24 - For signed builds: [PyCrypto module](https://www.dlitz.net/software/pycrypto/) | 
| 19 | 25 | 
| 20 ### Building the extension | 26 ### Building the extension | 
| 21 | 27 | 
| 22 Run the following command in the project directory: | 28 Run one of the following commands in the project directory, depending on your | 
| 29 target platform: | |
| 23 | 30 | 
| 24 ./build.py -t chrome build -k adblockpluschrome.pem | 31 ./build.py -t chrome build -k adblockpluschrome.pem | 
| 32 ./build.py -t gecko-webext build | |
| 25 | 33 | 
| 26 This will create a build with a name in the form | 34 This will create a build with a name in the form | 
| 27 _adblockpluschrome-1.2.3.nnnn.crx_ | 35 _adblockpluschrome-1.2.3.nnnn.crx_ or _adblockplusfirefox-1.2.3.nnnn.xpi_ | 
| 36 | |
| 28 Note that you don't need an existing signing key for Chrome, a new key | 37 Note that you don't need an existing signing key for Chrome, a new key | 
| 29 will be created automatically if the file doesn't exist. | 38 will be created automatically if the file doesn't exist. | 
| 30 | 39 | 
| 40 The Firefox extension will be unsigned, and therefore cannot be loaded directly | |
| 41 in Firefox, but is supposed to be uploaded to Mozilla add-ons. | |
| 
 
Wladimir Palant
2017/06/07 19:54:07
Unsigned extensions can be installed temporarily v
 
Sebastian Noack
2017/06/08 13:37:00
Done.
 
 | |
| 42 | |
| 31 ### Development environment | 43 ### Development environment | 
| 32 | 44 | 
| 33 To simplify the process of testing your changes you can create an unpacked | 45 To simplify the process of testing your changes you can create an unpacked | 
| 34 development environment. For that run the following command: | 46 development environment. For that run one of the following commands: | 
| 35 | 47 | 
| 36 ./build.py -t chrome devenv | 48 ./build.py -t chrome devenv | 
| 49 ./build.py -t gecko-webext devenv | |
| 37 | 50 | 
| 38 This will create a _devenv.chrome_ directory in the repository. In Chrome you | 51 This will create a _devenv.*_ directory in the repository. You can load the | 
| 39 should load the directory as an unpacked extension. After making changes to the | 52 directory as an unpacked extension, under _chrome://extensions_ in Chrome, | 
| 53 or under _about:debugging_ in Firefox. After making changes to the | |
| 40 source code re-run the command to update the development environment, the | 54 source code re-run the command to update the development environment, the | 
| 41 extension should reload automatically after a few seconds. | 55 extension should reload automatically after a few seconds. | 
| 42 | 56 | 
| 43 Running the unit tests | 57 Running the unit tests | 
| 44 ---------------------- | 58 ---------------------- | 
| 45 | 59 | 
| 46 To verify your changes you can use the unit test suite located in the _qunit_ | 60 To verify your changes you can use the unit test suite located in the _qunit_ | 
| 47 directory of the repository. In order to run the unit tests go to the | 61 directory of the repository. In order to run the unit tests go to the | 
| 48 extension's Options page, open the JavaScript Console and type in: | 62 extension's Options page, open the JavaScript Console and type in: | 
| 49 | 63 | 
| 50 location.href = "qunit/index.html"; | 64 location.href = "qunit/index.html"; | 
| 51 | 65 | 
| 52 The unit tests will run automatically once the page loads. | 66 The unit tests will run automatically once the page loads. | 
| 53 | 67 | 
| 54 Linting | 68 Linting | 
| 55 ------- | 69 ------- | 
| 56 | 70 | 
| 57 You can lint the code using [ESLint](http://eslint.org). | 71 You can lint the code using [ESLint](http://eslint.org). | 
| 58 | 72 | 
| 59 eslint *.js lib/ qunit/ ext/ chrome/ | 73 eslint *.js lib/ qunit/ ext/ chrome/ | 
| 60 | 74 | 
| 61 You will need to set up ESLint and our configuration first, see | 75 You will need to set up ESLint and our configuration first, see | 
| 62 [eslint-config-eyeo](https://hg.adblockplus.org/codingtools/file/tip/eslint-conf ig-eyeo) | 76 [eslint-config-eyeo](https://hg.adblockplus.org/codingtools/file/tip/eslint-conf ig-eyeo) | 
| 63 for more information. | 77 for more information. | 
| OLD | NEW |