pub struct ChromeCapabilities { /* private fields */ }
Implementations§
Source§impl ChromeCapabilities
impl ChromeCapabilities
Sourcepub fn add_chrome_option<T>(
&mut self,
key: &str,
value: T,
) -> WebDriverResult<()>where
T: Serialize,
pub fn add_chrome_option<T>(
&mut self,
key: &str,
value: T,
) -> WebDriverResult<()>where
T: Serialize,
Add the specified Chrome option. This is a helper method for add_chrome_arg()
.
Sourcepub fn get_chrome_option<T>(&self, key: &str) -> Twhere
T: DeserializeOwned + Default,
pub fn get_chrome_option<T>(&self, key: &str) -> Twhere
T: DeserializeOwned + Default,
Get the specified Chrome option.
Sourcepub fn get_args(&self) -> Vec<String>
pub fn get_args(&self) -> Vec<String>
Get the current list of command-line arguments to chromedriver
as a vec.
Sourcepub fn get_extensions(&self) -> Vec<String>
pub fn get_extensions(&self) -> Vec<String>
Get the current list of Chrome extensions as a vec.
Each item is a base64-encoded string containing the .CRX extension file contents.
Use add_extension()
to add a new extension file.
Sourcepub fn get_binary(&self) -> String
pub fn get_binary(&self) -> String
Get the path to the chrome binary (if one was previously set).
Sourcepub fn set_binary(&mut self, path: &str) -> WebDriverResult<()>
pub fn set_binary(&mut self, path: &str) -> WebDriverResult<()>
Set the path to chrome binary to use.
Sourcepub fn get_debugger_address(&self) -> String
pub fn get_debugger_address(&self) -> String
Get the current debugger address (if one was previously set).
Sourcepub fn set_debugger_address(&mut self, address: &str) -> WebDriverResult<()>
pub fn set_debugger_address(&mut self, address: &str) -> WebDriverResult<()>
Set the debugger address.
Sourcepub fn add_chrome_arg(&mut self, arg: &str) -> WebDriverResult<()>
pub fn add_chrome_arg(&mut self, arg: &str) -> WebDriverResult<()>
Add the specified command-line argument to chromedriver
. Eg. “–disable-local-storage”
The full list of switches can be found here:
https://chromium.googlesource.com/chromium/src/+/master/chrome/common/chrome_switches.cc
Sourcepub fn remove_chrome_arg(&mut self, arg: &str) -> WebDriverResult<()>
pub fn remove_chrome_arg(&mut self, arg: &str) -> WebDriverResult<()>
Remove the specified Chrome command-line argument if it had been added previously.
Sourcepub fn add_encoded_extension(
&mut self,
extension_base64: &str,
) -> WebDriverResult<()>
pub fn add_encoded_extension( &mut self, extension_base64: &str, ) -> WebDriverResult<()>
Add a base64-encoded extension.
Sourcepub fn remove_encoded_extension(
&mut self,
extension_base64: &str,
) -> WebDriverResult<()>
pub fn remove_encoded_extension( &mut self, extension_base64: &str, ) -> WebDriverResult<()>
Remove the specified base64-encoded extension if it had been added previously.
Sourcepub fn add_extension(&mut self, crx_file: &Path) -> WebDriverResult<()>
pub fn add_extension(&mut self, crx_file: &Path) -> WebDriverResult<()>
Add Chrome extension file. This will be a file with a .CRX extension.
Sourcepub fn remove_extension(&mut self, crx_file: &Path) -> WebDriverResult<()>
pub fn remove_extension(&mut self, crx_file: &Path) -> WebDriverResult<()>
Remove the specified Chrome extension file if an identical extension had been added previously.
Sourcepub fn set_headless(&mut self) -> WebDriverResult<()>
pub fn set_headless(&mut self) -> WebDriverResult<()>
Set the browser to run headless.
Sourcepub fn unset_headless(&mut self) -> WebDriverResult<()>
pub fn unset_headless(&mut self) -> WebDriverResult<()>
Unset the headless option.
Sourcepub fn set_disable_web_security(&mut self) -> WebDriverResult<()>
pub fn set_disable_web_security(&mut self) -> WebDriverResult<()>
Set disable web security.
Sourcepub fn unset_disable_web_security(&mut self) -> WebDriverResult<()>
pub fn unset_disable_web_security(&mut self) -> WebDriverResult<()>
Unset disable web security.
Sourcepub fn set_ignore_certificate_errors(&mut self) -> WebDriverResult<()>
pub fn set_ignore_certificate_errors(&mut self) -> WebDriverResult<()>
Set ignore certificate errors.
Sourcepub fn unset_ignore_certificate_errors(&mut self) -> WebDriverResult<()>
pub fn unset_ignore_certificate_errors(&mut self) -> WebDriverResult<()>
Unset ignore certificate errors.
pub fn set_no_sandbox(&mut self) -> WebDriverResult<()>
pub fn unset_no_sandbox(&mut self) -> WebDriverResult<()>
pub fn set_disable_gpu(&mut self) -> WebDriverResult<()>
pub fn unset_disable_gpu(&mut self) -> WebDriverResult<()>
pub fn set_disable_dev_shm_usage(&mut self) -> WebDriverResult<()>
pub fn unset_disable_dev_shm_usage(&mut self) -> WebDriverResult<()>
Methods from Deref<Target = Capabilities>§
Sourcepub fn get<Q>(&self, key: &Q) -> Option<&Value>
pub fn get<Q>(&self, key: &Q) -> Option<&Value>
Returns a reference to the value corresponding to the key.
The key may be any borrowed form of the map’s key type, but the ordering on the borrowed form must match the ordering on the key type.
Sourcepub fn contains_key<Q>(&self, key: &Q) -> bool
pub fn contains_key<Q>(&self, key: &Q) -> bool
Returns true if the map contains a value for the specified key.
The key may be any borrowed form of the map’s key type, but the ordering on the borrowed form must match the ordering on the key type.
Sourcepub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut Value>
pub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut Value>
Returns a mutable reference to the value corresponding to the key.
The key may be any borrowed form of the map’s key type, but the ordering on the borrowed form must match the ordering on the key type.
Sourcepub fn get_key_value<Q>(&self, key: &Q) -> Option<(&String, &Value)>
pub fn get_key_value<Q>(&self, key: &Q) -> Option<(&String, &Value)>
Returns the key-value pair matching the given key.
The key may be any borrowed form of the map’s key type, but the ordering on the borrowed form must match the ordering on the key type.
Sourcepub fn insert(&mut self, k: String, v: Value) -> Option<Value>
pub fn insert(&mut self, k: String, v: Value) -> Option<Value>
Inserts a key-value pair into the map.
If the map did not have this key present, None
is returned.
If the map did have this key present, the value is updated, and the old value is returned.
Sourcepub fn remove<Q>(&mut self, key: &Q) -> Option<Value>
pub fn remove<Q>(&mut self, key: &Q) -> Option<Value>
Removes a key from the map, returning the value at the key if the key was previously in the map.
The key may be any borrowed form of the map’s key type, but the ordering on the borrowed form must match the ordering on the key type.
Sourcepub fn remove_entry<Q>(&mut self, key: &Q) -> Option<(String, Value)>
pub fn remove_entry<Q>(&mut self, key: &Q) -> Option<(String, Value)>
Removes a key from the map, returning the stored key and value if the key was previously in the map.
The key may be any borrowed form of the map’s key type, but the ordering on the borrowed form must match the ordering on the key type.
Sourcepub fn append(&mut self, other: &mut Map<String, Value>)
pub fn append(&mut self, other: &mut Map<String, Value>)
Moves all elements from other into self, leaving other empty.
Sourcepub fn entry<S>(&mut self, key: S) -> Entry<'_>
pub fn entry<S>(&mut self, key: S) -> Entry<'_>
Gets the given key’s corresponding entry in the map for in-place manipulation.
Sourcepub fn values_mut(&mut self) -> ValuesMut<'_>
pub fn values_mut(&mut self) -> ValuesMut<'_>
Gets an iterator over mutable values of the map.
Trait Implementations§
Source§impl Clone for ChromeCapabilities
impl Clone for ChromeCapabilities
Source§fn clone(&self) -> ChromeCapabilities
fn clone(&self) -> ChromeCapabilities
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more