Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Dynamic filtering: quick guide

Raymond Hill edited this page Jan 20, 2015 · 53 revisions

No wall of text, let's cut to the chase.

Dynamic filtering pane (available only to advanced users):

figure 1


Important

Static filtering refers to the filters which comes from the filter lists, i.e. EasyList, EasyPrivacy, hpHosts, etc. Dynamic filtering are those filtering rules which have an air of firewall rules.


First column: what is to be dynamically filtered:

figure 2

As you can see, you can create dynamic filtering rules for object types, or hostnames according to their origin.

The color of an entry indicate whether all requests were blocked (reddish), all requests were allowed (greenish), or some were blocked some were allowed (yellowish).

In bold, domain names. Domain names are hostnames, but hostnames are not necessarily domain names from µBlock's point of view: domain names are extracted as per Mozilla Public Suffix list.

Second column: global dynamic filtering rules, i.e. whatever rule appears in this column applies everywhere, on all sites:

figure 3

Third column: local dynamic filtering rules, i.e. whatever rule appears in this column applies to the current site only:

figure 4

The cells in the third column gives an overview of how many requests were blocked/allowed:

  • - or + = between 1-9 network requests were blocked or allowed, respectively
  • -- or ++ = between 10-99 network requests were blocked or allowed, respectively
  • --- or +++ = 100 or more network requests were blocked or allowed, respectively
  • blank cell = no network requests occurred for the specific hostname

So there are global dynamic filtering rules, and local dynamic filtering rules.

Sensible security- and privacy-wise: blocking all 3rd-party frames by default everywhere:

figure 5


Important

Dynamic filtering override static filtering. This means a block dynamic rule will override any existing allow static filters. This means you can block with 100% certainty using dynamic filtering rules. Similarly, an allow dynamic filtering rule will override any existing block static filters, i.e. you can allow with 100% certainty with dynamic filtering (useful to un-break sites broken by some static filters).


All embedded 3rd-party frames were blocked on the page. Good. However it appears there was an embedded Youtube video in the article:

figure 6

If you want to block all 3rd-party frames by default, except for embedded Youtube videos on that particular site, two solutions.

First solution

Create a local noop rule for 3rd-party frames:

figure 7

It works, the embedded Youtube video can now be played.

However the above rule would result in all 3rd-party frames on the site to be unblocked. Not so good.

Second solution

Create a local noop rule for youtube.com:

figure 8

This will prevent dynamic filtering rules to apply to anything from youtube.com, but only on that site.


Important

Remember that noop rules bypass only broader dynamic filtering rules, static filtering is left completely intact, which means you won't see ads in the embedded Youtube videos.


What if you want to block 3rd-party frames everywhere by default, but want whatever embedded Youtube video to not be blocked by default on any site?

It is just a matter of creating a global noop rule for youtube.com:

figure 9

Which means: do not apply any dynamically filtering rule to youtube.com by default (i.e. everywhere).


Important

Local dynamic filtering rules override global ones.

More specific dynamic filtering rules override less specific ones. For example, dynamic filtering rules for youtube.com (specific) override dynamic filtering rules for 3rd-party frames (generic).


We covered the block and noop dynamic filtering rules. What about the allow rule?

The dynamic filtering allow rule is most useful to un-break sites broken by some static filters.

Someone found out Boldchat site was broken when using µBlock:

figure 10

The content of the dynamic filtering pane makes it clear that there is a static filter somewhere blocking network requests to boldchat.com. Turned out there was static filter boldchat.com in "Peter Lowe's Ad Server" list.

Using a local allow dynamic filtering rule fixes the breakage:

figure 11

It is easier for a user to point-and-click for a quick fix then to actually craft an exception static filter like @@||boldchat.com$~third-party and force a reload of all static filters (big memory churning).

Another example of un-breaking a site.


Important

Typically, use only narrow allow dynamic filtering rules to un-break sites. As these allow rules override any static filtering, this means if you use a too broad allow dynamic filtering rule you could start to allow in ads/trackers/annoyances.


More: Take control of your privacy in your own hands (will move this here eventually, I need a break)

Clone this wiki locally