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 storage_state: Option<StorageStateInput>,
pub verbose: bool,
pub node_executable: Option<PathBuf>,
pub node_working_dir: Option<PathBuf>,
pub downloads: DownloadSetting,
}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.
storage_state: Option<StorageStateInput>Playwright-compatible cookies and origin-scoped localStorage to restore.
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.
downloads: DownloadSettingManage the attached browser’s downloads.
The same setting and the same manager as
LaunchOptions, because a browser
somebody else started downloads files the same way — including the ones
a person clicks by hand. See downloads.
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 storage_state(self, state: impl Into<StorageStateInput>) -> Self
pub fn storage_state(self, state: impl Into<StorageStateInput>) -> Self
Restore portable state before returning the connected page.
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.
Sourcepub fn downloads(self, downloads: impl Into<DownloadSetting>) -> Self
pub fn downloads(self, downloads: impl Into<DownloadSetting>) -> Self
Manage the attached browser’s downloads.
§Arguments
downloads-truefor the defaults,falsefor none, orDownloadOptions
Trait Implementations§
Source§impl Clone for ConnectOptions
impl Clone for ConnectOptions
Source§impl Debug for ConnectOptions
impl Debug for ConnectOptions
Auto Trait Implementations§
impl !RefUnwindSafe for ConnectOptions
impl !UnwindSafe for ConnectOptions
impl Freeze for ConnectOptions
impl Send for ConnectOptions
impl Sync for ConnectOptions
impl Unpin for ConnectOptions
impl UnsafeUnpin for ConnectOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more