pub struct ConnectOptions {
pub engine: EngineType,
pub cdp_endpoint: Option<String>,
pub ws_endpoint: Option<String>,
pub slow_mo: u64,
pub timeout: Option<Duration>,
pub protocol_timeout: Option<Duration>,
pub seed_cookies: Vec<Value>,
pub verbose: bool,
pub node_executable: Option<PathBuf>,
pub node_working_dir: Option<PathBuf>,
}Expand description
Options for attaching to a running browser over CDP.
Fields§
§engine: EngineTypeBrowser automation engine used for the connection.
cdp_endpoint: Option<String>HTTP DevTools endpoint, for example http://127.0.0.1:9222.
ws_endpoint: Option<String>DevTools browser WebSocket endpoint.
slow_mo: u64Slow down Playwright/Puppeteer operations by this many milliseconds.
timeout: Option<Duration>Optional connection timeout.
protocol_timeout: Option<Duration>Optional Puppeteer timeout for individual CDP calls.
Cookies to seed after attaching, in CDP/Playwright cookie format.
verbose: boolEnable verbose bridge logging.
node_executable: Option<PathBuf>Node.js executable for Playwright/Puppeteer bridge engines.
node_working_dir: Option<PathBuf>Directory where Node resolves the Playwright/Puppeteer package.
Implementations§
Source§impl ConnectOptions
impl ConnectOptions
Sourcepub fn chromiumoxide() -> Self
pub fn chromiumoxide() -> Self
Create Chromiumoxide connection options.
Sourcepub fn playwright() -> Self
pub fn playwright() -> Self
Create Playwright bridge connection options.
Sourcepub fn cdp_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn cdp_endpoint(self, endpoint: impl Into<String>) -> Self
Select an HTTP DevTools endpoint.
Sourcepub fn ws_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn ws_endpoint(self, endpoint: impl Into<String>) -> Self
Select a DevTools browser WebSocket endpoint.
Sourcepub fn protocol_timeout(self, timeout: Duration) -> Self
pub fn protocol_timeout(self, timeout: Duration) -> Self
Set Puppeteer’s timeout for individual CDP calls.
Seed cookies immediately after the connection is established.
Sourcepub fn node_executable(self, executable: impl Into<PathBuf>) -> Self
pub fn node_executable(self, executable: impl Into<PathBuf>) -> Self
Override the Node.js executable for bridge engines.
Sourcepub fn node_working_dir(self, directory: impl Into<PathBuf>) -> Self
pub fn node_working_dir(self, directory: impl Into<PathBuf>) -> Self
Set the directory where Node resolves Playwright or Puppeteer.
Trait Implementations§
Source§impl Clone for ConnectOptions
impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
fn clone(&self) -> ConnectOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more