pub struct BrowserType { /* private fields */ }Expand description
A browser engine. Created from a Playwright handle.
Implementations§
Source§impl BrowserType
impl BrowserType
Sourcepub fn executable_path(&self) -> Option<PathBuf>
pub fn executable_path(&self) -> Option<PathBuf>
Best-effort discovery of the executable path for this engine.
Sourcepub async fn launch_with_options(&self, opts: LaunchOptions) -> Result<Browser>
pub async fn launch_with_options(&self, opts: LaunchOptions) -> Result<Browser>
Launch a browser with the given options.
Only Chromium is driven here; firefox/webkit log a warning and fall
back to launching Chromium (kept for porting compatibility).
Sourcepub async fn launch_persistent_context(
&self,
user_data_dir: impl AsRef<Path>,
) -> Result<BrowserContext>
pub async fn launch_persistent_context( &self, user_data_dir: impl AsRef<Path>, ) -> Result<BrowserContext>
Launch a browser with a persistent user-data-dir and return its default
BrowserContext. Cookies / localStorage persist to user_data_dir
across runs. Mirrors Playwright’s browserType.launchPersistentContext.
user_data_dir accepts any path-like value (impl AsRef<Path>), so you
can pass a &str, &Path, &PathBuf, or an owned PathBuf directly.
Sourcepub async fn launch_persistent_context_with_options(
&self,
user_data_dir: impl AsRef<Path>,
opts: LaunchOptions,
) -> Result<BrowserContext>
pub async fn launch_persistent_context_with_options( &self, user_data_dir: impl AsRef<Path>, opts: LaunchOptions, ) -> Result<BrowserContext>
Like launch_persistent_context but with
custom launch options. The user_data_dir passed here overrides any
user_data_dir set on opts.
user_data_dir accepts any path-like value (impl AsRef<Path>), so you
can pass a &str, &Path, &PathBuf, or an owned PathBuf directly.
Sourcepub async fn connect_over_cdp(
&self,
endpoint: &str,
opts: Option<ConnectOverCdpOptions>,
) -> Result<Browser>
pub async fn connect_over_cdp( &self, endpoint: &str, opts: Option<ConnectOverCdpOptions>, ) -> Result<Browser>
Attach to an already-running browser over CDP.
Trait Implementations§
Source§impl Clone for BrowserType
impl Clone for BrowserType
Source§fn clone(&self) -> BrowserType
fn clone(&self) -> BrowserType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more