class Playwright::BrowserType::LaunchPersistentContextOptions
- Playwright::BrowserType::LaunchPersistentContextOptions
- Reference
- Object
Included Modules
- JSON::Serializable
Defined in:
playwright/browsertype.crConstructors
- .new(pull : JSON::PullParser)
- .new(headless : Bool | Nil = nil, executable_path : Path | Nil = nil, args : Nil | Array(String) = nil, ignore_default_args : Nil | String = nil, proxy : Nil | Playwright::BrowserType::LaunchPersistentContextOptions::Proxy = nil, downloads_path : Path | Nil = nil, chromium_sandbox : Bool | Nil = nil, handle_sigint : Bool | Nil = nil, handle_sigterm : Bool | Nil = nil, handle_sighup : Bool | Nil = nil, timeout : Int32 | Nil = nil, env : Nil | String = nil, devtools : Bool | Nil = nil, slow_mo : Int32 | Nil = nil, accept_downloads : Bool | Nil = nil, ignore_https_errors : Bool | Nil = nil, bypass_csp : Bool | Nil = nil, viewport : Nil | Playwright::Page::ViewPort = nil, user_agent : Nil | String = nil, device_scale_factor : Int32 | Nil = nil, is_mobile : Bool | Nil = nil, has_touch : Bool | Nil = nil, java_script_enabled : Bool | Nil = nil, timezone_id : Nil | String = nil, geolocation : Nil | Playwright::Geolocation = nil, locale : Nil | String = nil, permissions : Nil | Array(String) = nil, extra_http_headers : Nil | Hash(String, String) = nil, offline : Bool | Nil = nil, http_credentials : Nil | Playwright::BrowserContext::HTTPCredentials = nil, color_scheme : Playwright::ColorScheme | Nil = nil, logger : Playwright::Logger | Nil = nil, record_har : Nil | Playwright::BrowserType::LaunchPersistentContextOptions::RecordHar = nil, record_video : Nil | Playwright::BrowserType::LaunchPersistentContextOptions::RecordVideo = nil)
Instance Method Summary
-
#accept_downloads : Bool | Nil
Whether to automatically download all the attachments.
-
#accept_downloads=(accept_downloads : Bool | Nil)
Whether to automatically download all the attachments.
-
#args : Array(String) | Nil
Additional arguments to pass to the browser instance.
-
#args=(args : Array(String) | Nil)
Additional arguments to pass to the browser instance.
-
#bypass_csp : Bool | Nil
Toggles bypassing page's Content-Security-Policy.
-
#bypass_csp=(bypass_csp : Bool | Nil)
Toggles bypassing page's Content-Security-Policy.
-
#chromium_sandbox : Bool | Nil
Enable Chromium sandboxing.
-
#chromium_sandbox=(chromium_sandbox : Bool | Nil)
Enable Chromium sandboxing.
-
#color_scheme : ColorScheme | Nil
Emulates
'prefers-colors-scheme'
media feature, supported values are'light'
,'dark'
,'no-preference'
. -
#color_scheme=(color_scheme : ColorScheme | Nil)
Emulates
'prefers-colors-scheme'
media feature, supported values are'light'
,'dark'
,'no-preference'
. -
#device_scale_factor : Int32 | Nil
Specify device scale factor (can be thought of as dpr).
-
#device_scale_factor=(device_scale_factor : Int32 | Nil)
Specify device scale factor (can be thought of as dpr).
-
#devtools : Bool | Nil
Chromium-only Whether to auto-open a Developer Tools panel for each tab.
-
#devtools=(devtools : Bool | Nil)
Chromium-only Whether to auto-open a Developer Tools panel for each tab.
-
#downloads_path : Path | Nil
If specified, accepted downloads are downloaded into this directory.
-
#downloads_path=(downloads_path : Path | Nil)
If specified, accepted downloads are downloaded into this directory.
-
#env : String | Nil
Specify environment variables that will be visible to the browser.
-
#env=(env : String | Nil)
Specify environment variables that will be visible to the browser.
-
#executable_path : Path | Nil
Path to a browser executable to run instead of the bundled one.
-
#executable_path=(executable_path : Path | Nil)
Path to a browser executable to run instead of the bundled one.
-
#extra_http_headers : Hash(String, String) | Nil
An object containing additional HTTP headers to be sent with every request.
-
#extra_http_headers=(extra_http_headers : Hash(String, String) | Nil)
An object containing additional HTTP headers to be sent with every request.
- #geolocation : Geolocation | Nil
- #geolocation=(geolocation : Geolocation | Nil)
-
#handle_sighup : Bool | Nil
Close the browser process on SIGHUP.
-
#handle_sighup=(handle_sighup : Bool | Nil)
Close the browser process on SIGHUP.
-
#handle_sigint : Bool | Nil
Close the browser process on Ctrl-C.
-
#handle_sigint=(handle_sigint : Bool | Nil)
Close the browser process on Ctrl-C.
-
#handle_sigterm : Bool | Nil
Close the browser process on SIGTERM.
-
#handle_sigterm=(handle_sigterm : Bool | Nil)
Close the browser process on SIGTERM.
-
#has_touch : Bool | Nil
Specifies if viewport supports touch events.
-
#has_touch=(has_touch : Bool | Nil)
Specifies if viewport supports touch events.
-
#headless : Bool | Nil
Whether to run browser in headless mode.
-
#headless=(headless : Bool | Nil)
Whether to run browser in headless mode.
-
#http_credentials : BrowserContext::HTTPCredentials | Nil
Credentials for HTTP authentication.
-
#http_credentials=(http_credentials : BrowserContext::HTTPCredentials | Nil)
Credentials for HTTP authentication.
-
#ignore_default_args : String | Nil
If
true
, then do not use any of the default arguments. -
#ignore_default_args=(ignore_default_args : String | Nil)
If
true
, then do not use any of the default arguments. -
#ignore_https_errors : Bool | Nil
Whether to ignore HTTPS errors during navigation.
-
#ignore_https_errors=(ignore_https_errors : Bool | Nil)
Whether to ignore HTTPS errors during navigation.
-
#is_mobile : Bool | Nil
Whether the
meta viewport
tag is taken into account and touch events are enabled. -
#is_mobile=(is_mobile : Bool | Nil)
Whether the
meta viewport
tag is taken into account and touch events are enabled. -
#java_script_enabled : Bool | Nil
Whether or not to enable JavaScript in the context.
-
#java_script_enabled=(java_script_enabled : Bool | Nil)
Whether or not to enable JavaScript in the context.
-
#locale : String | Nil
Specify user locale, for example
en-GB
,de-DE
, etc. -
#locale=(locale : String | Nil)
Specify user locale, for example
en-GB
,de-DE
, etc. -
#logger : Logger | Nil
Logger sink for Playwright logging.
-
#logger=(logger : Logger | Nil)
Logger sink for Playwright logging.
-
#offline : Bool | Nil
Whether to emulate network being offline.
-
#offline=(offline : Bool | Nil)
Whether to emulate network being offline.
-
#permissions : Array(String) | Nil
A list of permissions to grant to all pages in this context.
-
#permissions=(permissions : Array(String) | Nil)
A list of permissions to grant to all pages in this context.
-
#proxy : Proxy | Nil
Network proxy settings.
-
#proxy=(proxy : Proxy | Nil)
Network proxy settings.
-
#record_har : RecordHar | Nil
Enables HAR recording for all pages into
recordHar.path
file. -
#record_har=(record_har : RecordHar | Nil)
Enables HAR recording for all pages into
recordHar.path
file. -
#record_video : RecordVideo | Nil
Enables video recording for all pages into
recordVideo.dir
directory. -
#record_video=(record_video : RecordVideo | Nil)
Enables video recording for all pages into
recordVideo.dir
directory. -
#slow_mo : Int32 | Nil
Slows down Playwright operations by the specified amount of milliseconds.
-
#slow_mo=(slow_mo : Int32 | Nil)
Slows down Playwright operations by the specified amount of milliseconds.
-
#timeout : Int32 | Nil
Maximum time in milliseconds to wait for the browser instance to start.
-
#timeout=(timeout : Int32 | Nil)
Maximum time in milliseconds to wait for the browser instance to start.
-
#timezone_id : String | Nil
Changes the timezone of the context.
-
#timezone_id=(timezone_id : String | Nil)
Changes the timezone of the context.
-
#user_agent : String | Nil
Specific user agent to use in this context.
-
#user_agent=(user_agent : String | Nil)
Specific user agent to use in this context.
-
#viewport : Page::ViewPort | Nil
Sets a consistent viewport for each page.
-
#viewport=(viewport : Page::ViewPort | Nil)
Sets a consistent viewport for each page.
Constructor Detail
Instance Method Detail
Whether to automatically download all the attachments. Defaults to false
where all the downloads are canceled.
Whether to automatically download all the attachments. Defaults to false
where all the downloads are canceled.
Additional arguments to pass to the browser instance. The list of Chromium flags can be found here.
Additional arguments to pass to the browser instance. The list of Chromium flags can be found here.
Enable Chromium sandboxing. Defaults to true
.
Emulates 'prefers-colors-scheme'
media feature, supported values are 'light'
, 'dark'
, 'no-preference'
. See page.emulateMedia(params)
for more details. Defaults to 'light
'.
Emulates 'prefers-colors-scheme'
media feature, supported values are 'light'
, 'dark'
, 'no-preference'
. See page.emulateMedia(params)
for more details. Defaults to 'light
'.
Specify device scale factor (can be thought of as dpr). Defaults to 1
.
Specify device scale factor (can be thought of as dpr). Defaults to 1
.
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
.
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
.
If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is deleted when browser is closed.
If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is deleted when browser is closed.
Specify environment variables that will be visible to the browser. Defaults to process.env
.
Specify environment variables that will be visible to the browser. Defaults to process.env
.
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.
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.
An object containing additional HTTP headers to be sent with every request. All header values must be strings.
An object containing additional HTTP headers to be sent with every request. All header values must be strings.
Close the browser process on SIGHUP. Defaults to true
.
Close the browser process on Ctrl-C. Defaults to true
.
Close the browser process on SIGTERM. Defaults to true
.
Specifies if viewport supports touch events. Defaults to false.
Whether to run browser in headless mode. More details for Chromium and Firefox. Defaults to true
unless the #devtools
option is true
.
Whether to run browser in headless mode. More details for Chromium and Firefox. Defaults to true
unless the #devtools
option is true
.
Credentials for HTTP authentication.
If true
, then do not use any of the default arguments. If an array is given, then filter out the given default arguments. Dangerous option; use with care. Defaults to false
.
If true
, then do not use any of the default arguments. If an array is given, then filter out the given default arguments. Dangerous option; use with care. Defaults to false
.
Whether to ignore HTTPS errors during navigation. Defaults to false
.
Whether to ignore HTTPS errors during navigation. Defaults to false
.
Whether the meta viewport
tag is taken into account and touch events are enabled. Defaults to false
. Not supported in Firefox.
Whether the meta viewport
tag is taken into account and touch events are enabled. Defaults to false
. Not supported in Firefox.
Whether or not to enable JavaScript in the context. Defaults to true
.
Whether or not to enable JavaScript in the context. Defaults to true
.
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.
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.
A list of permissions to grant to all pages in this context. See browserContext.grantPermissions(permissions[, options])
for more details.
A list of permissions to grant to all pages in this context. See browserContext.grantPermissions(permissions[, options])
for more details.
Enables HAR recording for all pages into recordHar.path
file. If not specified, the HAR is not recorded. Make sure to await browserContext.close()
for the HAR to be saved.
Enables HAR recording for all pages into recordHar.path
file. If not specified, the HAR is not recorded. Make sure to await browserContext.close()
for the HAR to be saved.
Enables video recording for all pages into recordVideo.dir
directory. If not specified videos are not recorded. Make sure to await browserContext.close()
for videos to be saved.
Enables video recording for all pages into recordVideo.dir
directory. If not specified videos are not recorded. Make sure to await browserContext.close()
for videos to be saved.
Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on. Defaults to 0.
Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on. Defaults to 0.
Maximum time in milliseconds to wait for the browser instance to start. Defaults to 30000
(30 seconds). Pass 0
to disable timeout.
Maximum time in milliseconds to wait for the browser instance to start. Defaults to 30000
(30 seconds). Pass 0
to disable timeout.
Changes the timezone of the context. See ICU’s metaZones.txt
for a list of supported timezone IDs.
Changes the timezone of the context. See ICU’s metaZones.txt
for a list of supported timezone IDs.
Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. null
disables the default viewport.
Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. null
disables the default viewport.