LogoLogo
About GitLabAcceptable Ads
  • Getting Started
  • Browser Ad-Filtering Solution
    • Features
    • Getting Started
      • Quickstart
      • Integrate the Solution
      • Set up user counting
    • Guides
      • User counting
      • Configure Solution settings
      • Run separate instances of the filtering engine
      • Update the Solution
      • Understand the snippets library
      • Create a filter list
      • Testing
    • Advanced
      • Services and classes
      • Sitekey
      • ADRs
      • Frame hierarchy
  • Snippets
    • Snippets Overview
    • Behavioral Snippets
      • abort-current-inline-script
      • abort-on-property-read
      • abort-on-property-write
      • abort-on-iframe-property-read
      • abort-on-iframe-property-write
      • array-override
      • cookie-remover
      • freeze-element
      • json-override
      • json-prune
      • override-property-read
      • prevent-listener
      • replace-fetch-response
      • replace-xhr-response
      • simulate-mouse-event
      • skip-video
      • strip-fetch-query-parameter
    • Conditional Hiding Snippets
      • hide-if-canvas-contains
      • hide-if-contains
      • hide-if-contains-image
      • hide-if-contains-similar-text
      • hide-if-contains-visible-text
      • hide-if-contains-and-matches-style
      • hide-if-has-and-matches-style
      • hide-if-labelled-by
      • hide-if-matches-computed-xpath
      • hide-if-matches-xpath
      • hide-if-matches-xpath3
      • hide-if-shadow-contains
    • Debugging Snippets
      • debug
      • log
      • profile
      • trace
    • Performance Snippets
      • race
    • Snippets Support by Platform
    • Node Highlighting
    • Accessing shadow DOM elements
  • Working with filters
  • DATA AND PRIVACY
    • Data collection at eyeo
Powered by GitBook
On this page
  • Services
  • Important Chromium classes
  • Mapping to Chromium processes and threads

Was this helpful?

Edit on GitLab
Export as PDF
  1. Browser Ad-Filtering Solution
  2. Advanced

Services and classes

Last updated 1 year ago

Was this helpful?

This page lists the services and classes important to the eyeo Browser Ad-Filtering Solution, as well as the role each plays in the Solution's implementation.

Services

The Solution consists of the following main KeyedService services:

  • FilteringConfiguration; allows the

  • SubscriptionService; maintains a state of available subscriptions and synchronizes it with persistent storage.

  • ResourceClassificationRunner; decides whether to block or allow network requests.

  • ElementHider; applies element hiding scripts and stylesheets on web pages.

  • AdblockTelemetryService; reports anonymous usage statistics to eyeo.

  • SitekeyStorage; extracts, validates, and stores from response headers.

Important Chromium classes

The following Chromium classes play an important role in the Solution's implementation:

  • RenderFrameHost; allows finding the and executes element hiding CSS and JavaScript.

  • WebContentsObserver; receives page load events and injects element hiding; extended by AdblockWebContentsObserver.

  • ChromeContentBrowserClient ; extended by AdblockChromeContentBrowserClient in order to set up an internal proxy for inspecting network requests.

Mapping to Chromium processes and threads

  • Classification of network requests

  • Preparing element hiding selectors

  • Conversion/serialization of filter lists

  • Loading installed filter lists from disk

The Solution's logic executes primarily in the . The only exception is code under third_party/blink/renderer/core/exported/web_document.cc that injects element hiding stylesheets into the website - this runs in a Renderer process.

In the Browser process, code that might take a long time to execute runs asynchronously in the . Examples of such code:

control of resource filtering settings
SiteKeys
frame hierarchy
Browser process
ThreadPool