PersistentContextLauncher

Struct PersistentContextLauncher 

Source
pub struct PersistentContextLauncher<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k> {
    inner: Weak<BrowserType>,
    args: LaunchPersistentContextArgs<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k>,
}
Expand description

BrowserType::persistent_context_launcher

Has launch args and context args

Fields§

§inner: Weak<BrowserType>§args: LaunchPersistentContextArgs<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k>

Implementations§

Source§

impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k> PersistentContextLauncher<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k>

Source

pub async fn launch(self) -> Result<BrowserContext, Arc<Error>>

Source

fn new(inner: Weak<Impl>, user_data_dir: &'a Path) -> Self

Source

pub fn set_device(self, device: &'e DeviceDescriptor) -> Self

Source

pub fn executable(self, x: &'b Path) -> Self

Path to a browser executable to run instead of the bundled one. If executablePath is a relative path, then it is resolved relative to the current working directory. BEWARE: Playwright is only guaranteed to work with the bundled Chromium, Firefox or WebKit, use at your own risk.

Source

pub fn args(self, x: &'c [String]) -> Self

Additional arguments to pass to the browser instance. The list of Chromium flags can be found here.

Source

pub fn ignore_all_default_args(self, x: bool) -> Self

If true, Playwright does not pass its own configurations args and only uses the ones from args. Dangerous option; use with care. Defaults to false.

Source

pub fn handle_sighup(self, x: bool) -> Self

Close the browser process on SIGHUP. Defaults to true.

Source

pub fn handle_sigint(self, x: bool) -> Self

Close the browser process on Ctrl-C. Defaults to true.

Source

pub fn handle_sigterm(self, x: bool) -> Self

Close the browser process on SIGTERM. Defaults to true.

Source

pub fn timeout(self, x: f64) -> Self

Maximum time in milliseconds to wait for the browser instance to start. Defaults to 30000 (30 seconds). Pass 0 to disable timeout.

Source

pub fn env(self, x: Map<String, Value>) -> Self

Specify environment variables that will be visible to the browser. Defaults to process.env.

Source

pub fn headless(self, x: bool) -> Self

Whether to run browser in headless mode. More details for Chromium and Firefox. Defaults to true unless the devtools option is true.

Source

pub fn devtools(self, x: bool) -> Self

Chromium-only Whether to auto-open a Developer Tools panel for each tab. If this option is true, the headless option will be set false.

Source

pub fn proxy(self, x: ProxySettings) -> Self

Network proxy settings.

Source

pub fn downloads(self, x: &'d Path) -> Self

If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is deleted when browser is closed.

Source

pub fn slowmo(self, x: f64) -> Self

Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on. Defaults to 0.

Source

pub fn viewport(self, x: Option<Viewport>) -> Self

Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. null disables the default viewport.

Source

pub fn no_viewport(self, x: bool) -> Self

Does not enforce fixed viewport, allows resizing window in the headed mode.

Source

pub fn screen(self, x: Viewport) -> Self

Emulates consistent window screen size available inside web page via window.screen. Is only used when the viewport is set.

Source

pub fn ignore_https_errors(self, x: bool) -> Self

Whether to ignore HTTPS errors during navigation. Defaults to false.

Source

pub fn js_enabled(self, x: bool) -> Self

Whether or not to enable JavaScript in the context. Defaults to true.

Source

pub fn bypass_csp(self, x: bool) -> Self

Toggles bypassing page’s Content-Security-Policy.

Source

pub fn user_agent(self, x: &'e str) -> Self

Specific user agent to use in this context.

Source

pub fn locale(self, x: &'f str) -> Self

Specify user locale, for example en-GB, de-DE, etc. Locale will affect navigator.language value, Accept-Language request header value as well as number and date formatting rules.

Source

pub fn timezone_id(self, x: &'g str) -> Self

Changes the timezone of the context. See ICU’s metaZones.txt for a list of supported timezone IDs.

Source

pub fn geolocation(self, x: Geolocation) -> Self

Source

pub fn permissions(self, x: &'h [String]) -> Self

A list of permissions to grant to all pages in this context. See [method: BrowserContext.grantPermissions] for more details.

Source

pub fn extra_http_headers(self, x: HashMap<String, String>) -> Self

An object containing additional HTTP headers to be sent with every request. All header values must be strings.

Source

pub fn offline(self, x: bool) -> Self

Whether to emulate network being offline. Defaults to false.

Source

pub fn http_credentials(self, x: &'i HttpCredentials) -> Self

Credentials for HTTP authentication.

Source

pub fn device_scale_factor(self, x: f64) -> Self

Specify device scale factor (can be thought of as dpr). Defaults to 1.

Source

pub fn is_mobile(self, x: bool) -> Self

Whether the meta viewport tag is taken into account and touch events are enabled. Defaults to false. Not supported in Firefox.

Source

pub fn has_touch(self, x: bool) -> Self

Specifies if viewport supports touch events. Defaults to false.

Source

pub fn color_scheme(self, x: ColorScheme) -> Self

Emulates 'prefers-colors-scheme' media feature, supported values are 'light', 'dark', 'no-preference'. See [method: Page.emulateMedia] for more details. Defaults to 'light'.

Source

pub fn accept_downloads(self, x: bool) -> Self

Whether to automatically download all the attachments. Defaults to false where all the downloads are canceled.

Source

pub fn chromium_sandbox(self, x: bool) -> Self

Enable Chromium sandboxing. Defaults to true.

Source

pub fn record_video(self, x: RecordVideo<'j>) -> Self

Enables video recording for all pages into recordVideo.dir directory. If not specified videos are not recorded. Make sure to await [method: BrowserContext.close] for videos to be saved.

Source

pub fn record_har(self, x: RecordHar<'k>) -> Self

Enables HAR recording for all pages into recordHar.path file. If not specified, the HAR is not recorded. Make sure to await [method: BrowserContext.close] for the HAR to be saved.

Source

pub fn channel(self, x: BrowserChannel) -> Self

Source

pub fn clear_executable(self) -> Self

Source

pub fn clear_args(self) -> Self

Source

pub fn clear_ignore_all_default_args(self) -> Self

Source

pub fn clear_handle_sighup(self) -> Self

Source

pub fn clear_handle_sigint(self) -> Self

Source

pub fn clear_handle_sigterm(self) -> Self

Source

pub fn clear_timeout(self) -> Self

Source

pub fn clear_env(self) -> Self

Source

pub fn clear_headless(self) -> Self

Source

pub fn clear_devtools(self) -> Self

Source

pub fn clear_proxy(self) -> Self

Source

pub fn clear_downloads(self) -> Self

Source

pub fn clear_slowmo(self) -> Self

Source

pub fn clear_viewport(self) -> Self

Source

pub fn clear_no_viewport(self) -> Self

Source

pub fn clear_screen(self) -> Self

Source

pub fn clear_ignore_https_errors(self) -> Self

Source

pub fn clear_js_enabled(self) -> Self

Source

pub fn clear_bypass_csp(self) -> Self

Source

pub fn clear_user_agent(self) -> Self

Source

pub fn clear_locale(self) -> Self

Source

pub fn clear_timezone_id(self) -> Self

Source

pub fn clear_geolocation(self) -> Self

Source

pub fn clear_permissions(self) -> Self

Source

pub fn clear_extra_http_headers(self) -> Self

Source

pub fn clear_offline(self) -> Self

Source

pub fn clear_http_credentials(self) -> Self

Source

pub fn clear_device_scale_factor(self) -> Self

Source

pub fn clear_is_mobile(self) -> Self

Source

pub fn clear_has_touch(self) -> Self

Source

pub fn clear_color_scheme(self) -> Self

Source

pub fn clear_accept_downloads(self) -> Self

Source

pub fn clear_chromium_sandbox(self) -> Self

Source

pub fn clear_record_video(self) -> Self

Source

pub fn clear_record_har(self) -> Self

Source

pub fn clear_channel(self) -> Self

Auto Trait Implementations§

§

impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k> Freeze for PersistentContextLauncher<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k>

§

impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k> RefUnwindSafe for PersistentContextLauncher<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k>

§

impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k> Send for PersistentContextLauncher<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k>

§

impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k> Sync for PersistentContextLauncher<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k>

§

impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k> Unpin for PersistentContextLauncher<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k>

§

impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k> UnwindSafe for PersistentContextLauncher<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k>

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> Same for T

Source§

type Output = T

Should always be Self
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.