| blocker.rs |
Holds [`Blocker`], which handles all network-based adblocking queries. |
19780 |
- |
| content_blocking.rs |
Transforms filter rules into content blocking syntax used on iOS and MacOS. |
28369 |
- |
| cosmetic_filter_cache.rs |
Provides behavior related to cosmetic filtering - that is, modifying a page's contents after
it's been loaded into a browser. This is primarily used to hide or clean up unwanted page
elements that are served inline with the rest of the first-party content from a page, but can
also be used to inject JavaScript "scriptlets" that intercept and modify the behavior of
scripts on the page at runtime.
The primary API exposed by this module is the `CosmeticFilterCache` struct, which stores
cosmetic filters and allows them to be queried efficiently at runtime for any which may be
relevant to a particular page.
To build `CosmeticFilterCache`, use `CosmeticFilterCacheBuilder`. |
16004 |
- |
| cosmetic_filter_cache_builder.rs |
Provides API to prepare and serialize cosmetic filter rules to a flatbuffer.
To build the struct, use `CosmeticFilterCacheBuilder`.
To use the serialized rules, use `CosmeticFilterCache`. |
12492 |
- |
| cosmetic_filter_utils.rs |
Some utility functions for manipulating cosmetic filter rules.
Used by `CosmeticFilterCacheBuilder` and `CosmeticFilterCache`. |
5704 |
- |
| data_format |
|
|
- |
| engine.rs |
The adblock [`Engine`] is the primary interface for adblocking. |
13640 |
- |
| filters |
|
|
- |
| flatbuffers |
|
|
- |
| lib.rs |
`adblock-rust` is the engine powering Brave's native adblocker, available as a library for
anyone to use. It features:
- Network blocking
- Cosmetic filtering
- Resource replacements
- Hosts syntax
- uBlock Origin syntax extensions
- iOS content-blocking syntax conversion
- Compiling to native code or WASM
- Rust bindings ([crates](https://crates.io/crates/adblock))
- JS bindings ([npm](https://npmjs.com/adblock-rs))
- Community-maintained Python bindings ([pypi](https://pypi.org/project/adblock/))
- High performance!
Check the [`Engine`] documentation to get started with adblocking. |
1569 |
- |
| lists.rs |
Parsing functions and collections for handling with multiple filter rules. |
21596 |
- |
| network_filter_list.rs |
Holds the implementation of [NetworkFilterList] and related functionality. |
5623 |
- |
| optimizer.rs |
let union_domain_group = UnionDomainGroup {};
let (fused, unfused) = apply_optimisation(&union_domain_group, filters);
optimized.extend(fused);
|
6906 |
- |
| regex_manager.rs |
Compiled regexes can take up large amounts of memory. To reduce the overall memory footprint of
the [`crate::Engine`], infrequently used regexes can be discarded. The [`RegexManager`] is
responsible for managing the storage of regexes used by filters. |
12772 |
- |
| request.rs |
Contains structures needed to describe network requests. |
7570 |
- |
| resources |
|
|
- |
| url_parser |
|
|
- |
| utils.rs |
Common utilities used by the library. Some tests and benchmarks rely on this module having
public visibility. |
3620 |
- |