Module domain_manager

Module domain_manager 

Source
Expand description

CDP Domain Manager

Centralized helper that enables and disables Chrome DevTools Protocol domains.

§Design Goals

  1. Required Domains Managed Automatically: Core domains such as Page, Runtime, DOM, and Network can be enabled up-front and stay active for the lifetime of the page (RAII-style).
  2. Optional Domains On Demand: Optional domains like Fetch, Performance, and CSS expose explicit enable/disable helpers so they are activated only when needed.
  3. Guard Against Duplicate Operations: Internal state tracks each domain so repeated enable/disable calls become no-ops.
  4. Resource Efficiency: Domains remain disabled until requested, keeping browser overhead low.

§Examples

// Required domains (Page, Runtime, DOM, Network) are enabled when the page is created.

// Enable optional domains as needed.
page.domain_manager.enable_fetch_domain().await?;
page.domain_manager.enable_performance_domain().await?;

// Disable optional domains to free resources once finished.
page.domain_manager.disable_fetch_domain().await?;
page.domain_manager.disable_performance_domain().await?;

// When the page is dropped, all domains are cleaned up automatically.

Structs§

DomainConfig
Configuration values applied while enabling individual domains.
DomainManager
Coordinates enabling/disabling Chrome domains in a Page lifecycle.

Enums§

DomainState
Tracks the current enablement status for a domain.
DomainType
Enumerates known Chrome domains this crate manages.