pub struct LaunchOptionsBuilder<'a> { /* private fields */ }
Expand description

Builder for LaunchOptions.

Implementations§

source§

impl<'a> LaunchOptionsBuilder<'a>

source

pub fn headless(&mut self, value: bool) -> &mut Self

Determines whether to run headless version of the browser. Defaults to true.

source

pub fn sandbox(&mut self, value: bool) -> &mut Self

Determines whether to run the browser with a sandbox.

source

pub fn window_size(&mut self, value: Option<(u32, u32)>) -> &mut Self

Launch the browser with a specific window width and height.

source

pub fn port(&mut self, value: Option<u16>) -> &mut Self

Launch the browser with a specific debugging port.

source

pub fn ignore_certificate_errors(&mut self, value: bool) -> &mut Self

Determines whether SSL certificates should be verified. This is unsafe and can lead to MiTM attacks. Make sure you understand the risks See https://www.owasp.org/index.php/Man-in-the-middle_attack

source

pub fn path(&mut self, value: Option<PathBuf>) -> &mut Self

Path for Chrome or Chromium.

If unspecified, the create will try to automatically detect a suitable binary.

source

pub fn user_data_dir(&mut self, value: Option<PathBuf>) -> &mut Self

User Data (Profile) to use.

If unspecified, a new temp directory is created and used on every launch.

source

pub fn extensions(&mut self, value: Vec<&'a OsStr>) -> &mut Self

A list of Chrome extensions to load.

An extension should be a path to a folder containing the extension code. CRX files cannot be used directly and must be first extracted.

Note that Chrome does not support loading extensions in headless-mode. See https://bugs.chromium.org/p/chromium/issues/detail?id=706008#c5

source

pub fn args(&mut self, value: Vec<&'a OsStr>) -> &mut Self

Additional arguments to pass to the browser instance. The list of Chromium flags can be found: http://peter.sh/experiments/chromium-command-line-switches/.

source

pub fn disable_default_args(&mut self, value: bool) -> &mut Self

Disable default arguments

source

pub fn idle_browser_timeout(&mut self, value: Duration) -> &mut Self

How long to keep the WebSocket to the browser for after not receiving any events from it Defaults to 30 seconds

source

pub fn process_envs( &mut self, value: Option<HashMap<String, String>> ) -> &mut Self

Environment variables to set for the Chromium process. Passes value through to std::process::Command::envs.

source

pub fn proxy_server(&mut self, value: Option<&'a str>) -> &mut Self

Setup the proxy server for headless chrome instance

source

pub fn build(&self) -> Result<LaunchOptions<'a>, LaunchOptionsBuilderError>

Builds a new LaunchOptions.

Errors

If a required field has not been initialized.

Trait Implementations§

source§

impl<'a> Clone for LaunchOptionsBuilder<'a>

source§

fn clone(&self) -> LaunchOptionsBuilder<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a> Default for LaunchOptionsBuilder<'a>

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
§

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

§

fn vzip(self) -> V