pub struct BrowserConfigBuilder { /* private fields */ }Implementations§
Source§impl BrowserConfigBuilder
impl BrowserConfigBuilder
Sourcepub fn window_size(self, width: u32, height: u32) -> Self
pub fn window_size(self, width: u32, height: u32) -> Self
Configure window size.
Sourcepub fn no_sandbox(self) -> Self
pub fn no_sandbox(self) -> Self
Configure sandboxing.
Sourcepub fn new_headless_mode(self) -> Self
pub fn new_headless_mode(self) -> Self
Configure the launch with the new headless mode.
Sourcepub fn headless_mode(self, mode: HeadlessMode) -> Self
pub fn headless_mode(self, mode: HeadlessMode) -> Self
Configure the launch with headless.
pub fn respect_https_errors(self) -> Self
pub fn port(self, port: u16) -> Self
pub fn with_max_bytes_allowed(self, max_bytes_allowed: Option<u64>) -> Self
pub fn launch_timeout(self, timeout: Duration) -> Self
pub fn request_timeout(self, timeout: Duration) -> Self
Sourcepub fn viewport(self, viewport: impl Into<Option<Viewport>>) -> Self
pub fn viewport(self, viewport: impl Into<Option<Viewport>>) -> Self
Configures the viewport of the browser, which defaults to 800x600.
None disables viewport emulation (i.e., it uses the browsers default
configuration, which fills the available space. This is similar to what
Playwright does when you provide null as the value of its viewport
option).
pub fn user_data_dir(self, data_dir: impl AsRef<Path>) -> Self
pub fn chrome_executable(self, path: impl AsRef<Path>) -> Self
pub fn chrome_detection(self, options: DetectionOptions) -> Self
pub fn extension(self, extension: impl Into<String>) -> Self
pub fn extensions<I, S>(self, extensions: I) -> Self
pub fn env(self, key: impl Into<String>, val: impl Into<String>) -> Self
pub fn envs<I, K, V>(self, envs: I) -> Self
pub fn arg(self, arg: impl Into<String>) -> Self
pub fn args<I, S>(self, args: I) -> Self
pub fn disable_default_args(self) -> Self
pub fn enable_request_intercept(self) -> Self
pub fn disable_request_intercept(self) -> Self
pub fn enable_cache(self) -> Self
pub fn disable_cache(self) -> Self
Sourcepub fn set_service_worker_enabled(self, bypass: bool) -> Self
pub fn set_service_worker_enabled(self, bypass: bool) -> Self
Set service worker enabled.
Sourcepub fn set_extra_headers(self, headers: Option<HashMap<String, String>>) -> Self
pub fn set_extra_headers(self, headers: Option<HashMap<String, String>>) -> Self
Set extra request headers.
Sourcepub fn set_whitelist_patterns(
self,
whitelist_patterns: Option<Vec<String>>,
) -> Self
pub fn set_whitelist_patterns( self, whitelist_patterns: Option<Vec<String>>, ) -> Self
Set whitelist patterns to allow through network interception allowing.
Sourcepub fn set_blacklist_patterns(
self,
blacklist_patterns: Option<Vec<String>>,
) -> Self
pub fn set_blacklist_patterns( self, blacklist_patterns: Option<Vec<String>>, ) -> Self
Set blacklist patterns to block through network interception.
Sourcepub fn channel_capacity(self, capacity: usize) -> Self
pub fn channel_capacity(self, capacity: usize) -> Self
Set the capacity of the channel between browser handle and handler. Defaults to 1000.
Sourcepub fn connection_retries(self, retries: u32) -> Self
pub fn connection_retries(self, retries: u32) -> Self
Set the number of WebSocket connection retry attempts with exponential backoff. Defaults to 4. Set to 0 for a single attempt with no retries.
Sourcepub fn build(self) -> Result<BrowserConfig, String>
pub fn build(self) -> Result<BrowserConfig, String>
Build the browser.
Trait Implementations§
Source§impl Clone for BrowserConfigBuilder
impl Clone for BrowserConfigBuilder
Source§fn clone(&self) -> BrowserConfigBuilder
fn clone(&self) -> BrowserConfigBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more