Skip to content

Brave Adblock References: Syntax & Examples

Francois Marier edited this page Feb 27, 2019 · 3 revisions

References

Below is a summary of the most important rules. See https://adblockplus.org/filters for more information on this ruleset syntax and this wiki page for what is supported in Brave.

Writing blocking rules: syntax reference

  • Prefix with @@ for exceptions
  • Use || for host anchored filters
  • Use @@|| to allow a list with a host anchored filter
  • Append $domain=domainname.com to the end of a rule to apply that rule to a specific domain.
  • Append ^$third-party to rules that apply to third parties. example: ||thirdpartydomainexample.com^$third-party
  • Prefix notations with ! within a line break between rules, to describe the purpose for the next rule in the list. example: ! This rule applies for this thing which deserves notation

Site blocking rules: examples

Blocking rule that makes an exception for a network request

This would be used to make an exception in order to get a piece of content to work. Typically used a last resort option example: @@||tags.difficultvendorexample.com/folderexample/*/difficultfileexample.js$domain=difficultpubdomainexample.com

Blocking rule to block a network request

This would be used to block a network request in order to get a piece of content to work. Typically used for sites that use an anti-ad blocker that would obstruct content when ad blocking is detected. example: ||antiadblockingresourcehostexample.com/antiadblockingfileexample.js$domain=publisherdomainexample.com

Blocking rule to globally block a third party

This would be used to block a third network request for an ad server, vendor, etc. Example: ||thirdpartydomain.com^$third-party