This repository was archived by the owner on May 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 92
Testing ad block rule changes in Brave
Brian R. Bondy edited this page Apr 2, 2019
·
7 revisions
On 0.65.x and later, you can go to about:adblock where you can put manual ABP filters now. 1 per line.
- Clone
brave/ad-block - Clone
brave/adblock-lists - In your local
brave/adblock-listsrepository,git checkout -b YOUR_BRANCH_NAMEto make a branch - Make all your changes in your branch—probably in
brave-unbreak.txt—andgit committo save your changes locally -
git rev-parse HEADshould show the commit hash, otherwisegit logand find it. (You need the full hash.) -
git pushto push your changes to the remoteadblock-listsrepository on GitHub. Now your modifiedbrave-unbreak.txtfile has a unique URL onraw.githubusercontent.com. - Now, in your local
brave/ad-blockrepository, editlists/default.hto point to your changed version, similar to this example but specifying the commit hash you found earlier:
diff --git a/lists/default.h b/lists/default.h
index fce7a03..77e2a12 100644
--- a/lists/default.h
+++ b/lists/default.h
@@ -46,7 +46,7 @@ const std::vector<FilterList> default_lists = {
""
}, {
"2FBEB0BC-E2E1-4170-BAA9-05E76AAB5BA5",
- "https://raw.githubusercontent.com/brave/adblock-lists/master/brave-unbreak.txt", // NOLINT
+ "https://raw.githubusercontent.com/brave/adblock-lists/YOUR_COMMIT_HASH/brave-unbreak.txt",
"Brave Unblock",
{},
"https://github.com/brave/adblock-lists",
- Still in your local
brave/ad-blockrepository,npm run build && npm run data-filesto build the changes into the node library and rebuild the data files. This creates files in theout/subdirectory. The changes you made tobrave-unbreak.txtare reflected in theABPFilterParserData.datfile in this subdirectory. - Close Brave
- Copy the local file you built (in
brave/ad-block/out/) to your profile extension directory:cp out/ABPFilterParserData.dat ~/Library/Application\ Support/BraveSoftware/Brave-Browser/cffkpbalmllkdoenhmdmpbkajipdjfam/1.0.135/4/ - Launch Brave and test