pub struct BrowserContextOptionsBuilder { /* private fields */ }Expand description
Builder for BrowserContextOptions
Implementations§
Source§impl BrowserContextOptionsBuilder
impl BrowserContextOptionsBuilder
Sourcepub fn no_viewport(self, no_viewport: bool) -> Self
pub fn no_viewport(self, no_viewport: bool) -> Self
Disables viewport emulation
Sourcepub fn user_agent(self, user_agent: String) -> Self
pub fn user_agent(self, user_agent: String) -> Self
Sets the user agent string
Sourcepub fn timezone_id(self, timezone_id: String) -> Self
pub fn timezone_id(self, timezone_id: String) -> Self
Sets the timezone identifier
Sourcepub fn geolocation(self, geolocation: Geolocation) -> Self
pub fn geolocation(self, geolocation: Geolocation) -> Self
Sets the geolocation
Sourcepub fn permissions(self, permissions: Vec<String>) -> Self
pub fn permissions(self, permissions: Vec<String>) -> Self
Sets the permissions to grant
Sourcepub fn color_scheme(self, color_scheme: String) -> Self
pub fn color_scheme(self, color_scheme: String) -> Self
Sets the color scheme preference
Sourcepub fn has_touch(self, has_touch: bool) -> Self
pub fn has_touch(self, has_touch: bool) -> Self
Sets whether the viewport supports touch events
Sourcepub fn javascript_enabled(self, javascript_enabled: bool) -> Self
pub fn javascript_enabled(self, javascript_enabled: bool) -> Self
Sets whether JavaScript is enabled
Sourcepub fn accept_downloads(self, accept_downloads: bool) -> Self
pub fn accept_downloads(self, accept_downloads: bool) -> Self
Sets whether to automatically download attachments
Sourcepub fn bypass_csp(self, bypass_csp: bool) -> Self
pub fn bypass_csp(self, bypass_csp: bool) -> Self
Sets whether to bypass Content-Security-Policy
Sourcepub fn ignore_https_errors(self, ignore_https_errors: bool) -> Self
pub fn ignore_https_errors(self, ignore_https_errors: bool) -> Self
Sets whether to ignore HTTPS errors
Sourcepub fn device_scale_factor(self, device_scale_factor: f64) -> Self
pub fn device_scale_factor(self, device_scale_factor: f64) -> Self
Sets the device scale factor
Sourcepub fn extra_http_headers(
self,
extra_http_headers: HashMap<String, String>,
) -> Self
pub fn extra_http_headers( self, extra_http_headers: HashMap<String, String>, ) -> Self
Sets extra HTTP headers
Sourcepub fn build(self) -> BrowserContextOptions
pub fn build(self) -> BrowserContextOptions
Builds the BrowserContextOptions
Trait Implementations§
Source§impl Clone for BrowserContextOptionsBuilder
impl Clone for BrowserContextOptionsBuilder
Source§fn clone(&self) -> BrowserContextOptionsBuilder
fn clone(&self) -> BrowserContextOptionsBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BrowserContextOptionsBuilder
impl Debug for BrowserContextOptionsBuilder
Source§impl Default for BrowserContextOptionsBuilder
impl Default for BrowserContextOptionsBuilder
Source§fn default() -> BrowserContextOptionsBuilder
fn default() -> BrowserContextOptionsBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for BrowserContextOptionsBuilder
impl RefUnwindSafe for BrowserContextOptionsBuilder
impl Send for BrowserContextOptionsBuilder
impl Sync for BrowserContextOptionsBuilder
impl Unpin for BrowserContextOptionsBuilder
impl UnwindSafe for BrowserContextOptionsBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more