This repository has been archived by the owner on May 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 90
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-lists
repository,git checkout -b YOUR_BRANCH_NAME
to make a branch - Make all your changes in your branch—probably in
brave-unbreak.txt
—andgit commit
to save your changes locally -
git rev-parse HEAD
should show the commit hash, otherwisegit log
and find it. (You need the full hash.) -
git push
to push your changes to the remoteadblock-lists
repository on GitHub. Now your modifiedbrave-unbreak.txt
file has a unique URL onraw.githubusercontent.com
. - Now, in your local
brave/ad-block
repository, editlists/default.h
to 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-block
repository,npm run build && npm run data-files
to build the changes into the node library and rebuild the data files. This creates files in theout/
subdirectory. The changes you made tobrave-unbreak.txt
are reflected in theABPFilterParserData.dat
file 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