public static class BrowserType.LaunchOptions extends Object
| Modifier and Type | Field and Description |
|---|---|
List<String> |
args
Additional arguments to pass to the browser instance.
|
BrowserChannel |
channel
Browser distribution channel.
|
Boolean |
chromiumSandbox
Enable Chromium sandboxing.
|
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,Object> |
firefoxUserPrefs
Firefox user preferences.
|
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 |
headless
Whether to run browser in headless mode.
|
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. |
Proxy |
proxy
Network proxy settings.
|
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.
|
| Constructor and Description |
|---|
LaunchOptions() |
public List<String> args
public BrowserChannel channel
public Boolean chromiumSandbox
false.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. Note that Playwright only works with the bundled Chromium, Firefox
or WebKit, use at your own risk.public Map<String,Object> firefoxUserPrefs
about:config.public Boolean handleSIGHUP
true.public Boolean handleSIGINT
true.public Boolean handleSIGTERM
true.public Boolean headless
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 Proxy proxy
public Double slowMo
public Double timeout
30000 (30 seconds). Pass 0 to
disable timeout.public BrowserType.LaunchOptions setArgs(List<String> args)
public BrowserType.LaunchOptions setChannel(BrowserChannel channel)
public BrowserType.LaunchOptions setChromiumSandbox(boolean chromiumSandbox)
public BrowserType.LaunchOptions setDevtools(boolean devtools)
public BrowserType.LaunchOptions setDownloadsPath(Path downloadsPath)
public BrowserType.LaunchOptions setEnv(Map<String,String> env)
public BrowserType.LaunchOptions setExecutablePath(Path executablePath)
public BrowserType.LaunchOptions setFirefoxUserPrefs(Map<String,Object> firefoxUserPrefs)
public BrowserType.LaunchOptions setHandleSIGHUP(boolean handleSIGHUP)
public BrowserType.LaunchOptions setHandleSIGINT(boolean handleSIGINT)
public BrowserType.LaunchOptions setHandleSIGTERM(boolean handleSIGTERM)
public BrowserType.LaunchOptions setHeadless(boolean headless)
public BrowserType.LaunchOptions setIgnoreAllDefaultArgs(boolean ignoreAllDefaultArgs)
public BrowserType.LaunchOptions setIgnoreDefaultArgs(List<String> ignoreDefaultArgs)
public BrowserType.LaunchOptions setProxy(String server)
public BrowserType.LaunchOptions setProxy(Proxy proxy)
public BrowserType.LaunchOptions setSlowMo(double slowMo)
public BrowserType.LaunchOptions setTimeout(double timeout)
Copyright © 2021. All rights reserved.