Struct FirefoxOptions

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

Utility struct to adjust the firefox browser session

For more info on FF Options please check https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities/firefoxOptions

Implementations§

Source§

impl FirefoxOptions

Source

pub fn new() -> Self

Source

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

Absolute path to the custom Firefox binary to use.

Source

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

More info on the FF args here: https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options?redirectlocale=en-US&redirectslug=Command_Line_Options

Source

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

As there are various prefs types, this methods takes a string representation of json.

§Examples
let mut ff = FirefoxOptions::new();
let prefs = r#"{dom.ipc.processCount": 8,"javascript.options.showInConsole": false}"#;
ff.add_prefs(prefs);
Source

pub fn add_log(&mut self, log_level: LogLevel) -> &mut Self

Option to increase the logging verbosity of geckodriver

Source

pub fn add_env(&mut self, env_vars: HashMap<&str, &str>) -> &mut Self

Map of environment variable name to environment variable value

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.