0

I want to make a custom filter rule for Brave Shield and according to this help page, "Brave is broadly compatible with uBlock Origin's filter rule syntax." along with a link to the documentation. But this is all too overwhelming for me and I don't know what I should be looking for when I just want to do a simple thing: allow a domain or URL to bypass the Brave Shield on a particular website.

Example:

  1. I go on website.com.
  2. website.com embeds content from external.com
  3. external.com is blocked by Brave Shield so its content doesn't load properly on website.com.

How do I write a custom filter that allows external.com to bypass Brave Shield but only when it's embedded on website.com?

0

2 Answers 2

0

Generally adding @@||external.com^ inside the brave://adblock custom rules should work for that.

0
0

You are likely looking for domain with negation. So:

||external.com^$domain=~website.com

That will block external.com everywhere except on website.com in uBlock origin. So it might not work for certain scenarios of e.g. iframe doing further requests.

It's supposed to be supported also in Brave. Can't say if it works with your quite inexplicit example.


Slightly more accurate but once again not fully supported in Brave:

||external.com^$document
||external.com^$domain=~website.com,3p

This blocks both root document (to cover external.com directly) and 3rd party scripts (to cover external.com in iframes etc. without affecting 1st party requests) in uBlock Origin.

But even though Brave supports $document according to the link above, it doesn't seem to work in latest version for me. I'd recommend raising an issue there. Or just using uBlock Origin as it's a much better adblocker.

2
  • It does work on uBlock Origin, but sadly does not on Brave Shield so I assume this is just unsupported in Brave Commented Jan 16 at 18:38
  • Pretty sure it's impossible within Brave currently then.
    – Destroy666
    Commented Jan 16 at 19:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .