Skip to main content

BrowserClient

Struct BrowserClient 

Source
pub struct BrowserClient { /* private fields */ }
Expand description

Client for Browser domain commands.

Implementations§

Source§

impl BrowserClient

Source

pub async fn set_permission( &self, params: SetPermissionParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

Set permission settings for given embedding and embedded origins.

Source

pub async fn grant_permissions( &self, params: GrantPermissionsParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

Grant specific permissions to the given origin and reject all others. Deprecated. Use setPermission instead.

Source

pub async fn reset_permissions( &self, params: ResetPermissionsParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

Reset all permission management for all origins.

Source

pub async fn set_download_behavior( &self, params: SetDownloadBehaviorParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

Set the behavior when downloading a file.

Source

pub async fn cancel_download( &self, params: CancelDownloadParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

Cancel a download if in progress

Source

pub async fn close(&self, session_id: Option<&str>) -> Result<Value, CdpError>

Close browser gracefully.

Source

pub async fn crash(&self, session_id: Option<&str>) -> Result<Value, CdpError>

Crashes browser on the main thread.

Source

pub async fn crash_gpu_process( &self, session_id: Option<&str>, ) -> Result<Value, CdpError>

Crashes GPU process.

Source

pub async fn get_version( &self, session_id: Option<&str>, ) -> Result<GetVersionReturns, CdpError>

Returns version information.

Source

pub async fn get_browser_command_line( &self, session_id: Option<&str>, ) -> Result<GetBrowserCommandLineReturns, CdpError>

Returns the command line switches for the browser process if, and only if –enable-automation is on the commandline.

Source

pub async fn get_histograms( &self, params: GetHistogramsParams, session_id: Option<&str>, ) -> Result<GetHistogramsReturns, CdpError>

Get Chrome histograms.

Source

pub async fn get_histogram( &self, params: GetHistogramParams, session_id: Option<&str>, ) -> Result<GetHistogramReturns, CdpError>

Get a Chrome histogram by name.

Source

pub async fn get_window_bounds( &self, params: GetWindowBoundsParams, session_id: Option<&str>, ) -> Result<GetWindowBoundsReturns, CdpError>

Get position and size of the browser window.

Source

pub async fn get_window_for_target( &self, params: GetWindowForTargetParams, session_id: Option<&str>, ) -> Result<GetWindowForTargetReturns, CdpError>

Get the browser window that contains the devtools target.

Source

pub async fn set_window_bounds( &self, params: SetWindowBoundsParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

Set position and/or size of the browser window.

Source

pub async fn set_contents_size( &self, params: SetContentsSizeParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

Set size of the browser contents resizing browser window as necessary.

Source

pub async fn set_dock_tile( &self, params: SetDockTileParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

Set dock tile details, platform-specific.

Source

pub async fn execute_browser_command( &self, params: ExecuteBrowserCommandParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

Invoke custom browser commands used by telemetry.

Source

pub async fn add_privacy_sandbox_enrollment_override( &self, params: AddPrivacySandboxEnrollmentOverrideParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

Allows a site to use privacy sandbox features that require enrollment without the site actually being enrolled. Only supported on page targets.

Source

pub async fn add_privacy_sandbox_coordinator_key_config( &self, params: AddPrivacySandboxCoordinatorKeyConfigParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

Configures encryption keys used with a given privacy sandbox API to talk to a trusted coordinator. Since this is intended for test automation only, coordinatorOrigin must be a .test domain. No existing coordinator configuration for the origin may exist.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more