pub struct DomainManager { /* private fields */ }Expand description
Coordinates enabling/disabling Chrome domains in a Page lifecycle.
Implementations§
Source§impl DomainManager
impl DomainManager
Sourcepub async fn enable_required_domains(&self) -> Result<()>
pub async fn enable_required_domains(&self) -> Result<()>
Enables the required domains (Page, Runtime, DOM, Network).
Call this immediately after constructing a Page to ensure core features work.
Sourcepub async fn disable_all_domains(&self) -> Result<()>
pub async fn disable_all_domains(&self) -> Result<()>
Disables every domain that is currently enabled.
This is automatically invoked when the manager is dropped, but can be called manually to free resources earlier.
Sourcepub async fn is_enabled(&self, domain: DomainType) -> bool
pub async fn is_enabled(&self, domain: DomainType) -> bool
Returns true if the specified domain is enabled or currently enabling.
Sourcepub async fn get_state(&self, domain: DomainType) -> DomainState
pub async fn get_state(&self, domain: DomainType) -> DomainState
Returns the current state tracked for the domain.
Sourcepub async fn enable_page_domain(&self) -> Result<()>
pub async fn enable_page_domain(&self) -> Result<()>
Enables the Page domain.
Sourcepub async fn enable_runtime_domain(&self) -> Result<()>
pub async fn enable_runtime_domain(&self) -> Result<()>
Enables the Runtime domain.
Sourcepub async fn enable_dom_domain(&self) -> Result<()>
pub async fn enable_dom_domain(&self) -> Result<()>
Enables the DOM domain.
Sourcepub async fn enable_network_domain(&self) -> Result<()>
pub async fn enable_network_domain(&self) -> Result<()>
Enables the Network domain.
Sourcepub async fn enable_fetch_domain(&self) -> Result<()>
pub async fn enable_fetch_domain(&self) -> Result<()>
Enables the Fetch domain so requests can be intercepted.
Sourcepub async fn enable_fetch_domain_with_patterns(
&self,
patterns: Option<Vec<RequestPattern>>,
) -> Result<()>
pub async fn enable_fetch_domain_with_patterns( &self, patterns: Option<Vec<RequestPattern>>, ) -> Result<()>
Enables the Fetch domain using the provided request interception patterns.
Sourcepub async fn disable_fetch_domain(&self) -> Result<()>
pub async fn disable_fetch_domain(&self) -> Result<()>
Disables the Fetch domain.
Sourcepub async fn enable_performance_domain(&self) -> Result<()>
pub async fn enable_performance_domain(&self) -> Result<()>
Enables the Performance domain.
Sourcepub async fn disable_performance_domain(&self) -> Result<()>
pub async fn disable_performance_domain(&self) -> Result<()>
Disables the Performance domain.