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>
impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k> PersistentContextLauncher<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k>
pub async fn launch(self) -> Result<BrowserContext, Arc<Error>>
fn new(inner: Weak<Impl>, user_data_dir: &'a Path) -> Self
pub fn set_device(self, device: &'e DeviceDescriptor) -> Self
Sourcepub fn executable(self, x: &'b Path) -> Self
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.
Sourcepub fn args(self, x: &'c [String]) -> Self
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.
Sourcepub fn ignore_all_default_args(self, x: bool) -> Self
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.
Sourcepub fn handle_sighup(self, x: bool) -> Self
pub fn handle_sighup(self, x: bool) -> Self
Close the browser process on SIGHUP. Defaults to true.
Sourcepub fn handle_sigint(self, x: bool) -> Self
pub fn handle_sigint(self, x: bool) -> Self
Close the browser process on Ctrl-C. Defaults to true.
Sourcepub fn handle_sigterm(self, x: bool) -> Self
pub fn handle_sigterm(self, x: bool) -> Self
Close the browser process on SIGTERM. Defaults to true.
Sourcepub fn timeout(self, x: f64) -> Self
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.
Sourcepub fn env(self, x: Map<String, Value>) -> Self
pub fn env(self, x: Map<String, Value>) -> Self
Specify environment variables that will be visible to the browser. Defaults to process.env.
Sourcepub fn devtools(self, x: bool) -> Self
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.
Sourcepub fn proxy(self, x: ProxySettings) -> Self
pub fn proxy(self, x: ProxySettings) -> Self
Network proxy settings.
Sourcepub fn downloads(self, x: &'d Path) -> Self
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.
Sourcepub fn slowmo(self, x: f64) -> Self
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.
Sourcepub fn viewport(self, x: Option<Viewport>) -> Self
pub fn viewport(self, x: Option<Viewport>) -> Self
Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. null disables the default viewport.
Sourcepub fn no_viewport(self, x: bool) -> Self
pub fn no_viewport(self, x: bool) -> Self
Does not enforce fixed viewport, allows resizing window in the headed mode.
Sourcepub fn screen(self, x: Viewport) -> Self
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.
Sourcepub fn ignore_https_errors(self, x: bool) -> Self
pub fn ignore_https_errors(self, x: bool) -> Self
Whether to ignore HTTPS errors during navigation. Defaults to false.
Sourcepub fn js_enabled(self, x: bool) -> Self
pub fn js_enabled(self, x: bool) -> Self
Whether or not to enable JavaScript in the context. Defaults to true.
Sourcepub fn bypass_csp(self, x: bool) -> Self
pub fn bypass_csp(self, x: bool) -> Self
Toggles bypassing page’s Content-Security-Policy.
Sourcepub fn user_agent(self, x: &'e str) -> Self
pub fn user_agent(self, x: &'e str) -> Self
Specific user agent to use in this context.
Sourcepub fn locale(self, x: &'f str) -> Self
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.
Sourcepub fn timezone_id(self, x: &'g str) -> Self
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.
pub fn geolocation(self, x: Geolocation) -> Self
Sourcepub fn permissions(self, x: &'h [String]) -> Self
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.
Sourcepub fn extra_http_headers(self, x: HashMap<String, String>) -> Self
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.
Sourcepub fn offline(self, x: bool) -> Self
pub fn offline(self, x: bool) -> Self
Whether to emulate network being offline. Defaults to false.
Sourcepub fn http_credentials(self, x: &'i HttpCredentials) -> Self
pub fn http_credentials(self, x: &'i HttpCredentials) -> Self
Credentials for HTTP authentication.
Sourcepub fn device_scale_factor(self, x: f64) -> Self
pub fn device_scale_factor(self, x: f64) -> Self
Specify device scale factor (can be thought of as dpr). Defaults to 1.
Sourcepub fn is_mobile(self, x: bool) -> Self
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.
Sourcepub fn has_touch(self, x: bool) -> Self
pub fn has_touch(self, x: bool) -> Self
Specifies if viewport supports touch events. Defaults to false.
Sourcepub fn color_scheme(self, x: ColorScheme) -> Self
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'.
Sourcepub fn accept_downloads(self, x: bool) -> Self
pub fn accept_downloads(self, x: bool) -> Self
Whether to automatically download all the attachments. Defaults to false where all the downloads are canceled.
Sourcepub fn chromium_sandbox(self, x: bool) -> Self
pub fn chromium_sandbox(self, x: bool) -> Self
Enable Chromium sandboxing. Defaults to true.
Sourcepub fn record_video(self, x: RecordVideo<'j>) -> Self
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.
Sourcepub fn record_har(self, x: RecordHar<'k>) -> Self
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.