Understand the Snippets Library
What are snippets?
Snippets are pieces of JavaScript code, injected by the Ad-Filtering Solution, that execute within the context of a website and combat advanced ads that circumvent ordinary blocking.
How snippets work
Snippets function as JavaScript functions that may accept optional arguments. The system stores them in a library and selects them for execution based on filter list content, which also specifies any parameters. A single website can have multiple snippets with different arguments running simultaneously.
Requirements for using snippets
To execute snippets on websites, you need:
-
A sufficiently recent version of the snippet library
-
The Anti-CV filter list subscription (enabled by default)
Verify the Anti-CV filter subscription
The Anti-CV filter list comes pre-subscribed. If missing from your configuration, subscribe through FilteringConfiguration or platform-specific APIs.
Keeping the snippets library up to date
The built-in library version is specified in the DEPS file. Starting with chromium version 139 releases, the Solution automatically checks eyeo servers for updates and downloads new versions when available.
For older versions, consult this compatibility chart:
|
Snippet library version |
Required Solution version |
|---|---|
|
0.5.1 |
105+ |
|
0.8.1 |
117+ |
|
1.2.0 |
123+ |
Update the preloaded snippets library
-
Update the desired version in the DEPS file
-
Execute
gclient syncto retrieve the new library version locally -
Rebuild the browser with
ninja -C out/...