Struct ChromeOptions

Source
pub struct ChromeOptions { /* private fields */ }
Expand description

Utility struct to adjust the chrome browser session

For more info pls check the chromedriver docs at https://chromedriver.chromium.org/capabilities

Implementations§

Source§

impl ChromeOptions

Source

pub fn new() -> Self

Source

pub fn add_args(&mut self, args: Vec<&str>) -> &mut Self

List of arguments to be passed to the Chrome browser on launch

§Examples
let args = vec!["--headless","--window-size=800,600"];
let mut ch = ChromeOptions::new();
ch.add_args(args);
Source

pub fn add_binary(&mut self, path: &str) -> &mut Self

Path to chrome executable

Source

pub fn add_extensions(&mut self, extensions: Vec<&str>) -> &mut Self

Each item in the vec should be a base-64 encoded packed Chrome extension (.crx)

Source

pub fn add_local_state(&mut self, local_state: HashMap<&str, &str>) -> &mut Self

Local state preferences’ names and values.

Source

pub fn add_prefs(&mut self, prefs: HashMap<&str, &str>) -> &mut Self

User profile preferences’ names and values.

Source

pub fn add_detach(&mut self, detach: bool) -> &mut Self

If false, Chrome will be quit when ChromeDriver is killed even if the session is still active

Source

pub fn add_debugger_address(&mut self, address: &str) -> &mut Self

An address of a Chrome debugger server to connect to, for example, e.g. “127.0.0.1:38947”

Source

pub fn add_exclude_switches(&mut self, switches: Vec<&str>) -> &mut Self

List of Chrome command line switches to exclude

Source

pub fn add_minidump_path(&mut self, path: &str) -> &mut Self

Only for Linux. Directory to store Chrome minidumps

Source

pub fn add_mobile_emulation(&mut self, device: MobileDevice) -> &mut Self

See the MobileDevice struct for more info

Source

pub fn add_perf_logging_prefs(&mut self, prefs: PerfLoggingPrefs) -> &mut Self

Pls check chromedriver docs for more info

Source

pub fn add_window_types(&mut self, window_types: Vec<&str>) -> &mut Self

A list of window types that will appear in the list of window handles.

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.