Skip to content
This repository has been archived by the owner. It is now read-only.

Testing ad block rule changes in Brave

Mark Pilgrim edited this page Feb 26, 2019 · 7 revisions
  1. Clone brave/ad-block
  2. Clone brave/adblock-lists
  3. cd adblock-lists
  4. git checkout -b YOUR_BRANCH_NAME to make a branch in your local adblock-lists repository
  5. Make all your changes in your branch—probably in brave-unbreak.txt—and git commit to save your changes locally
  6. git rev-parse HEAD should show the commit hash, otherwise git log and find it. (You need the full hash.)
  7. git push to push your changes to the remote adblock-lists repository on GitHub. Now your modified brave-unbreak.txt file has a unique URL on raw.githubusercontent.com.
  8. Apply a local only patch to brave/ad-block similar 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",
  1. Build the changes into the node library with npm run build
  2. Rebuild the data files: npm run data-files (This uses node so don't forget the previous step to build!)
  3. Close Brave
  4. Copy the local file you built to your profile extension directory: 
cp ~/Library/Application\ Support/BraveSoftware/Brave-Browser/cffkpbalmllkdoenhmdmpbkajipdjfam/1.0.135/4/ABPFilterParserData.dat
You can’t perform that action at this time.