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

Builder for LaunchOptions.

Implementations§

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

Determines whether to run the browser with a sandbox.

Launch the browser with a specific window width and height.

Launch the browser with a specific debugging port.

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

Path for Chrome or Chromium.

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

Examples found in repository?
src/browser/mod.rs (line 108)
106
107
108
109
110
111
112
    pub fn default() -> Result<Self> {
        let launch_options = LaunchOptions::default_builder()
            .path(Some(default_executable().unwrap()))
            .build()
            .unwrap();
        Ok(Self::new(launch_options).unwrap())
    }

User Data (Profile) to use.

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

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

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

Disable default arguments

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

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

Setup the proxy server for headless chrome instance

Builds a new LaunchOptions.

Errors

If a required field has not been initialized.

Examples found in repository?
src/browser/mod.rs (line 109)
106
107
108
109
110
111
112
    pub fn default() -> Result<Self> {
        let launch_options = LaunchOptions::default_builder()
            .path(Some(default_executable().unwrap()))
            .build()
            .unwrap();
        Ok(Self::new(launch_options).unwrap())
    }

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Get the TypeId of this object.