This repository has been archived by the owner. It is now read-only.
Testing ad block rule changes in Brave
- Clone
brave/ad-block - Clone
brave/adblock-lists cd adblock-lists-
git checkout -b YOUR_BRANCH_NAMEto make a branch in your localadblock-listsrepository - 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. - Apply a local only patch to
brave/ad-blocksimilar to this 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",
- Build the changes into the node library with
npm run build - Rebuild the data files:
npm run data-files(This uses node so don't forget the previous step to build!) - Close Brave
- Copy the local file you built (in
ad-block/out/) to your profile extension directory:cp ad-block/out/ABPFilterParserData.dat ~/Library/Application\ Support/BraveSoftware/Brave-Browser/cffkpbalmllkdoenhmdmpbkajipdjfam/1.0.135/4/ - Launch Brave and test