pub struct LaunchOptions {
pub engine: EngineType,
pub user_data_dir: Option<PathBuf>,
pub headless: bool,
pub slow_mo: u64,
pub verbose: bool,
pub args: Vec<String>,
pub color_scheme: Option<ColorScheme>,
pub launch_timeout: Option<Duration>,
pub sandbox: bool,
}Expand description
Options for launching a browser.
Fields§
§engine: EngineTypeThe browser engine to use.
user_data_dir: Option<PathBuf>Path to user data directory.
headless: boolRun in headless mode.
slow_mo: u64Slow down operations by this many milliseconds.
verbose: boolEnable verbose logging.
args: Vec<String>Additional Chrome arguments.
color_scheme: Option<ColorScheme>Color scheme to emulate. None uses the system default.
launch_timeout: Option<Duration>Optional timeout for the browser launch handshake.
sandbox: boolWhether to run the browser with the Chromium sandbox enabled.
Defaults to true. Disable when running in environments where the
sandbox is unavailable (e.g. CI containers without the required
capabilities). This translates to the --no-sandbox /
--disable-setuid-sandbox Chromium flags.
Implementations§
Source§impl LaunchOptions
impl LaunchOptions
Sourcepub fn chromiumoxide() -> Self
pub fn chromiumoxide() -> Self
Create options for chromiumoxide engine.
Sourcepub fn fantoccini() -> Self
pub fn fantoccini() -> Self
Create options for fantoccini (WebDriver) engine.
Sourcepub fn user_data_dir(self, dir: impl Into<PathBuf>) -> Self
pub fn user_data_dir(self, dir: impl Into<PathBuf>) -> Self
Set the user data directory.
Sourcepub fn color_scheme(self, color_scheme: ColorScheme) -> Self
pub fn color_scheme(self, color_scheme: ColorScheme) -> Self
Set the color scheme for media emulation.
Sourcepub fn launch_timeout(self, timeout: Duration) -> Self
pub fn launch_timeout(self, timeout: Duration) -> Self
Override the browser launch timeout.
Sourcepub fn sandbox(self, sandbox: bool) -> Self
pub fn sandbox(self, sandbox: bool) -> Self
Enable or disable the Chromium sandbox for the launched browser.
Sourcepub fn all_chrome_args(&self) -> Vec<String>
pub fn all_chrome_args(&self) -> Vec<String>
Get all Chrome arguments (default + custom).
Sourcepub fn get_user_data_dir(&self) -> PathBuf
pub fn get_user_data_dir(&self) -> PathBuf
Get the user data directory, using a default if not specified.
Trait Implementations§
Source§impl Clone for LaunchOptions
impl Clone for LaunchOptions
Source§fn clone(&self) -> LaunchOptions
fn clone(&self) -> LaunchOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LaunchOptions
impl Debug for LaunchOptions
Auto Trait Implementations§
impl Freeze for LaunchOptions
impl RefUnwindSafe for LaunchOptions
impl Send for LaunchOptions
impl Sync for LaunchOptions
impl Unpin for LaunchOptions
impl UnsafeUnpin for LaunchOptions
impl UnwindSafe for LaunchOptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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