Overview of uBlock's network filtering engine: details - uBlockOrigin/uBlock-issues GitHub Wiki
Overview
Overview of uBlock's network filtering engine
Dynamic URL filtering rules
Advantages:
- Little overhead creating/deleting dynamic URL rules.
- Precedence over both dynamic filtering rules and static filters.
- Useful to diagnose/fix in a very narrow way websites broken by either dynamic filtering rules or static filtering.
- Useful to create override to current dynamic filtering rules or static filtering.
- A point and click UI for easy management of rules.
Disadvantages:
- Can only match URLs which "start with".
- Can't be loaded from a filter list.
Dynamic filtering rules
Advantages:
- Little overhead creating/deleting dynamic rules.
- Precedence over static filters.
- A point and click UI for easy management of rules.
Disadvantages:
- Rules are broad: whole sites or class of types.
- Can't be loaded from a filter list.
Static filtering
Advantages:
- Flexible syntax: from very broad to very narrow targeting, with support of wildcards at any position.
- Support cosmetic filtering (removal of DOM elements).
- Can be loaded from a filter list: facilitate community-supported filter lists.
- Compatibility: can be used in other blockers supporting ABP-compatible filter syntax.
- Except for a few filter syntax extensions specific to uBlock not adopted by other blockers.
Disadvantages:
- High overhead creating/deleting network/cosmetic filters (high memory churn).
- In case of 3rd-party filter lists, forced to use all filters, including those which may not be wanted.
Why are rules "dynamic" and filters "static" if both are declarative?
"Static" means it must be "compiled" ahead-of-time before being used, and "dynamic" means it can effortlessly change at runtime:
- Rules: you can set rules with a simple mouse clicks in the user interface, they are virtually zero overhead to create/remove.
- Filters: all filters must be all reloaded in memory when adding/removing.