public static class BrowserType.LaunchPersistentContextOptions extends Object
| Modifier and Type | Field and Description |
|---|---|
Boolean |
acceptDownloads
Whether to automatically download all the attachments.
|
List<String> |
args
Additional arguments to pass to the browser instance.
|
Boolean |
bypassCSP
Toggles bypassing page's Content-Security-Policy.
|
BrowserChannel |
channel
Browser distribution channel.
|
Boolean |
chromiumSandbox
Enable Chromium sandboxing.
|
ColorScheme |
colorScheme
Emulates
"prefers-colors-scheme" media feature, supported values are "light", "dark", "no-preference". |
Double |
deviceScaleFactor
Specify device scale factor (can be thought of as dpr).
|
Boolean |
devtools
**Chromium-only** Whether to auto-open a Developer Tools panel for each tab.
|
Path |
downloadsPath
If specified, accepted downloads are downloaded into this directory.
|
Map<String,String> |
env
Specify environment variables that will be visible to the browser.
|
Path |
executablePath
Path to a browser executable to run instead of the bundled one.
|
Map<String,String> |
extraHTTPHeaders
An object containing additional HTTP headers to be sent with every request.
|
Geolocation |
geolocation |
Boolean |
handleSIGHUP
Close the browser process on SIGHUP.
|
Boolean |
handleSIGINT
Close the browser process on Ctrl-C.
|
Boolean |
handleSIGTERM
Close the browser process on SIGTERM.
|
Boolean |
hasTouch
Specifies if viewport supports touch events.
|
Boolean |
headless
Whether to run browser in headless mode.
|
HttpCredentials |
httpCredentials
Credentials for HTTP authentication.
|
Boolean |
ignoreAllDefaultArgs
If
true, Playwright does not pass its own configurations args and only uses the ones from args. |
List<String> |
ignoreDefaultArgs
If
true, Playwright does not pass its own configurations args and only uses the ones from args. |
Boolean |
ignoreHTTPSErrors
Whether to ignore HTTPS errors during navigation.
|
Boolean |
isMobile
Whether the
meta viewport tag is taken into account and touch events are enabled. |
Boolean |
javaScriptEnabled
Whether or not to enable JavaScript in the context.
|
String |
locale
Specify user locale, for example
en-GB, de-DE, etc. |
Boolean |
offline
Whether to emulate network being offline.
|
List<String> |
permissions
A list of permissions to grant to all pages in this context.
|
Proxy |
proxy
Network proxy settings.
|
Boolean |
recordHarOmitContent
Optional setting to control whether to omit request content from the HAR.
|
Path |
recordHarPath
Enables HAR recording for all pages into the specified HAR
file on the filesystem.
|
Path |
recordVideoDir
Enables video recording for all pages into the specified directory.
|
RecordVideoSize |
recordVideoSize
Dimensions of the recorded videos.
|
ScreenSize |
screenSize
Emulates consistent window screen size available inside web page via
window.screen. |
Double |
slowMo
Slows down Playwright operations by the specified amount of milliseconds.
|
Double |
timeout
Maximum time in milliseconds to wait for the browser instance to start.
|
String |
timezoneId
Changes the timezone of the context.
|
String |
userAgent
Specific user agent to use in this context.
|
Optional<ViewportSize> |
viewportSize
Emulates consistent viewport for each page.
|
| Constructor and Description |
|---|
LaunchPersistentContextOptions() |
public Boolean acceptDownloads
false where all the downloads are canceled.public List<String> args
public Boolean bypassCSP
public BrowserChannel channel
public Boolean chromiumSandbox
true.public ColorScheme colorScheme
"prefers-colors-scheme" media feature, supported values are "light", "dark", "no-preference". See
Page.emulateMedia() for more details. Defaults to "light".public Double deviceScaleFactor
1.public Boolean devtools
true, the headless
option will be set false.public Path downloadsPath
public Map<String,String> env
process.env.public Path executablePath
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.public Map<String,String> extraHTTPHeaders
public Geolocation geolocation
public Boolean handleSIGHUP
true.public Boolean handleSIGINT
true.public Boolean handleSIGTERM
true.public Boolean hasTouch
public Boolean headless
public HttpCredentials httpCredentials
public Boolean ignoreAllDefaultArgs
true, Playwright does not pass its own configurations args and only uses the ones from args. Dangerous option;
use with care. Defaults to false.public List<String> ignoreDefaultArgs
true, Playwright does not pass its own configurations args and only uses the ones from args. Dangerous option;
use with care.public Boolean ignoreHTTPSErrors
false.public Boolean isMobile
meta viewport tag is taken into account and touch events are enabled. Defaults to false. Not supported
in Firefox.public Boolean javaScriptEnabled
true.public String locale
en-GB, de-DE, etc. Locale will affect navigator.language value, Accept-Language
request header value as well as number and date formatting rules.public Boolean offline
false.public List<String> permissions
BrowserContext.grantPermissions() for more details.public Proxy proxy
public Boolean recordHarOmitContent
false.public Path recordHarPath
BrowserContext.close() for the HAR to be saved.public Path recordVideoDir
BrowserContext.close() for videos to be saved.public RecordVideoSize recordVideoSize
viewport scaled down to fit into
800x800. If viewport is not configured explicitly the video size defaults to 800x450. Actual picture of each page will
be scaled down if necessary to fit the specified size.public ScreenSize screenSize
window.screen. Is only used when the viewport
is set.public Double slowMo
public Double timeout
30000 (30 seconds). Pass 0 to
disable timeout.public String timezoneId
public String userAgent
public Optional<ViewportSize> viewportSize
null disables the default viewport.public BrowserType.LaunchPersistentContextOptions setAcceptDownloads(boolean acceptDownloads)
public BrowserType.LaunchPersistentContextOptions setArgs(List<String> args)
public BrowserType.LaunchPersistentContextOptions setBypassCSP(boolean bypassCSP)
public BrowserType.LaunchPersistentContextOptions setChannel(BrowserChannel channel)
public BrowserType.LaunchPersistentContextOptions setChromiumSandbox(boolean chromiumSandbox)
public BrowserType.LaunchPersistentContextOptions setColorScheme(ColorScheme colorScheme)
public BrowserType.LaunchPersistentContextOptions setDeviceScaleFactor(double deviceScaleFactor)
public BrowserType.LaunchPersistentContextOptions setDevtools(boolean devtools)
public BrowserType.LaunchPersistentContextOptions setDownloadsPath(Path downloadsPath)
public BrowserType.LaunchPersistentContextOptions setEnv(Map<String,String> env)
public BrowserType.LaunchPersistentContextOptions setExecutablePath(Path executablePath)
public BrowserType.LaunchPersistentContextOptions setExtraHTTPHeaders(Map<String,String> extraHTTPHeaders)
public BrowserType.LaunchPersistentContextOptions setGeolocation(double latitude, double longitude)
public BrowserType.LaunchPersistentContextOptions setGeolocation(Geolocation geolocation)
public BrowserType.LaunchPersistentContextOptions setHandleSIGHUP(boolean handleSIGHUP)
public BrowserType.LaunchPersistentContextOptions setHandleSIGINT(boolean handleSIGINT)
public BrowserType.LaunchPersistentContextOptions setHandleSIGTERM(boolean handleSIGTERM)
public BrowserType.LaunchPersistentContextOptions setHasTouch(boolean hasTouch)
public BrowserType.LaunchPersistentContextOptions setHeadless(boolean headless)
public BrowserType.LaunchPersistentContextOptions setHttpCredentials(String username, String password)
public BrowserType.LaunchPersistentContextOptions setHttpCredentials(HttpCredentials httpCredentials)
public BrowserType.LaunchPersistentContextOptions setIgnoreAllDefaultArgs(boolean ignoreAllDefaultArgs)
public BrowserType.LaunchPersistentContextOptions setIgnoreDefaultArgs(List<String> ignoreDefaultArgs)
public BrowserType.LaunchPersistentContextOptions setIgnoreHTTPSErrors(boolean ignoreHTTPSErrors)
public BrowserType.LaunchPersistentContextOptions setIsMobile(boolean isMobile)
public BrowserType.LaunchPersistentContextOptions setJavaScriptEnabled(boolean javaScriptEnabled)
public BrowserType.LaunchPersistentContextOptions setLocale(String locale)
public BrowserType.LaunchPersistentContextOptions setOffline(boolean offline)
public BrowserType.LaunchPersistentContextOptions setPermissions(List<String> permissions)
public BrowserType.LaunchPersistentContextOptions setProxy(String server)
public BrowserType.LaunchPersistentContextOptions setProxy(Proxy proxy)
public BrowserType.LaunchPersistentContextOptions setRecordHarOmitContent(boolean recordHarOmitContent)
public BrowserType.LaunchPersistentContextOptions setRecordHarPath(Path recordHarPath)
public BrowserType.LaunchPersistentContextOptions setRecordVideoDir(Path recordVideoDir)
public BrowserType.LaunchPersistentContextOptions setRecordVideoSize(int width, int height)
public BrowserType.LaunchPersistentContextOptions setRecordVideoSize(RecordVideoSize recordVideoSize)
public BrowserType.LaunchPersistentContextOptions setScreenSize(int width, int height)
public BrowserType.LaunchPersistentContextOptions setScreenSize(ScreenSize screenSize)
public BrowserType.LaunchPersistentContextOptions setSlowMo(double slowMo)
public BrowserType.LaunchPersistentContextOptions setTimeout(double timeout)
public BrowserType.LaunchPersistentContextOptions setTimezoneId(String timezoneId)
public BrowserType.LaunchPersistentContextOptions setUserAgent(String userAgent)
public BrowserType.LaunchPersistentContextOptions setViewportSize(int width, int height)
public BrowserType.LaunchPersistentContextOptions setViewportSize(ViewportSize viewportSize)
Copyright © 2021. All rights reserved.