Write exception rule

The function of exception rule is mainly used to correct the common blocking rules caused by the wrong kill, for example, we wrote a general rule can block most cases of advertising. But in some cases, the normal content is blocked, so we can add an exception rule to avoid the normal content blocking.

Url blocking exception rule

“@@” is used as the identifier for the Url blocking exception rule, followed immediately by the normal URL blocking rule

As an example, we have written the following URL blocking rule

/path/of/ad*

Resource URLs like the following will be hit

https://www.example.com/path/of/ad/banner.js
https://www.example.com/path/of/ad-show.js
https://www.example.com/path/of/advanced/

But the last resource URL is a normal resource content, because the rule “/path/of/ad*” was killed by mistake, so we can add an exception rule to avoid the normal resource URL being killed by mistake.

@@www.example.com/path/of/advanced/

We can see that the exception rule is written very simply, that is, “@@” followed by a normal URL rule, but this URL rule is not used to match advertisements, but to match a normal resource that was killed by mistake.

Exception rules can also include domain scope constraints, such as the following rules

@@/path/of/advanced@example.com

This exception rule is only in effect for sites with the current secondary domain name “example.com”.

@@/path/of/advanced$domain=example.com

Equivalent ABP rule syntax

Hide elements exception rule

“@#” is used as the identifier for the Hide elements exception rule rule, followed immediately by the normal hidden elements rule.

The Hide elements exception rule is for global hide elements rule, for example, like the following rule.

##div[title*="ad"]

Suppose the following page elements exist in the website www.example.com

<div tilte="advanced">
some content
</div>

This element will be hit by the above rule, then we just need to add the following exception rule to avoid being killed by mistake

@#div[title*="ad"]@example.com

Equivalent ABP rule syntax

example.com#@#div[title*="ad"]