Package com.microsoft.playwright
Class BrowserType.LaunchOptions
java.lang.Object
com.microsoft.playwright.BrowserType.LaunchOptions
- Enclosing interface:
BrowserType
-
Field Summary
FieldsModifier and TypeFieldDescriptionAdditional arguments to pass to the browser instance.Browser distribution channel.Enable Chromium sandboxing.**Chromium-only** Whether to auto-open a Developer Tools panel for each tab.If specified, accepted downloads are downloaded into this directory.Specify environment variables that will be visible to the browser.Path to a browser executable to run instead of the bundled one.Firefox user preferences.Close the browser process on SIGHUP.Close the browser process on Ctrl-C.Close the browser process on SIGTERM.Whether to run browser in headless mode.Iftrue, Playwright does not pass its own configurations args and only uses the ones fromargs.Iftrue, Playwright does not pass its own configurations args and only uses the ones fromargs.Network proxy settings.Slows down Playwright operations by the specified amount of milliseconds.Maximum time in milliseconds to wait for the browser instance to start.If specified, traces are saved into this directory. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdditional arguments to pass to the browser instance.setChannel(BrowserChannel channel) Deprecated.setChannel(String channel) Browser distribution channel.setChromiumSandbox(boolean chromiumSandbox) Enable Chromium sandboxing.setDevtools(boolean devtools) **Chromium-only** Whether to auto-open a Developer Tools panel for each tab.setDownloadsPath(Path downloadsPath) If specified, accepted downloads are downloaded into this directory.Specify environment variables that will be visible to the browser.setExecutablePath(Path executablePath) Path to a browser executable to run instead of the bundled one.setFirefoxUserPrefs(Map<String, Object> firefoxUserPrefs) Firefox user preferences.setHandleSIGHUP(boolean handleSIGHUP) Close the browser process on SIGHUP.setHandleSIGINT(boolean handleSIGINT) Close the browser process on Ctrl-C.setHandleSIGTERM(boolean handleSIGTERM) Close the browser process on SIGTERM.setHeadless(boolean headless) Whether to run browser in headless mode.setIgnoreAllDefaultArgs(boolean ignoreAllDefaultArgs) Iftrue, Playwright does not pass its own configurations args and only uses the ones fromargs.setIgnoreDefaultArgs(List<String> ignoreDefaultArgs) Iftrue, Playwright does not pass its own configurations args and only uses the ones fromargs.Network proxy settings.Network proxy settings.setSlowMo(double slowMo) Slows down Playwright operations by the specified amount of milliseconds.setTimeout(double timeout) Maximum time in milliseconds to wait for the browser instance to start.setTracesDir(Path tracesDir) If specified, traces are saved into this directory.
-
Field Details
-
args
Additional arguments to pass to the browser instance. The list of Chromium flags can be found here. -
channel
Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge", "msedge-beta", "msedge-dev", "msedge-canary". Read more about using Google Chrome and Microsoft Edge. -
chromiumSandbox
Enable Chromium sandboxing. Defaults tofalse. -
devtools
**Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option istrue, theheadlessoption will be setfalse. -
downloadsPath
If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is deleted when browser is closed. In either case, the downloads are deleted when the browser context they were created in is closed. -
env
Specify environment variables that will be visible to the browser. Defaults toprocess.env. -
executablePath
Path to a browser executable to run instead of the bundled one. IfexecutablePathis 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. -
firefoxUserPrefs
Firefox user preferences. Learn more about the Firefox user preferences atabout:config. -
handleSIGHUP
Close the browser process on SIGHUP. Defaults totrue. -
handleSIGINT
Close the browser process on Ctrl-C. Defaults totrue. -
handleSIGTERM
Close the browser process on SIGTERM. Defaults totrue. -
headless
-
ignoreAllDefaultArgs
Iftrue, Playwright does not pass its own configurations args and only uses the ones fromargs. Dangerous option; use with care. Defaults tofalse. -
ignoreDefaultArgs
Iftrue, Playwright does not pass its own configurations args and only uses the ones fromargs. Dangerous option; use with care. -
proxy
Network proxy settings. -
slowMo
Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on. -
timeout
Maximum time in milliseconds to wait for the browser instance to start. Defaults to30000(30 seconds). Pass0to disable timeout. -
tracesDir
If specified, traces are saved into this directory.
-
-
Constructor Details
-
LaunchOptions
public LaunchOptions()
-
-
Method Details
-
setArgs
Additional arguments to pass to the browser instance. The list of Chromium flags can be found here. -
setChannel
Deprecated. -
setChannel
Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge", "msedge-beta", "msedge-dev", "msedge-canary". Read more about using Google Chrome and Microsoft Edge. -
setChromiumSandbox
Enable Chromium sandboxing. Defaults tofalse. -
setDevtools
**Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option istrue, theheadlessoption will be setfalse. -
setDownloadsPath
If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is deleted when browser is closed. In either case, the downloads are deleted when the browser context they were created in is closed. -
setEnv
Specify environment variables that will be visible to the browser. Defaults toprocess.env. -
setExecutablePath
Path to a browser executable to run instead of the bundled one. IfexecutablePathis 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. -
setFirefoxUserPrefs
Firefox user preferences. Learn more about the Firefox user preferences atabout:config. -
setHandleSIGHUP
Close the browser process on SIGHUP. Defaults totrue. -
setHandleSIGINT
Close the browser process on Ctrl-C. Defaults totrue. -
setHandleSIGTERM
Close the browser process on SIGTERM. Defaults totrue. -
setHeadless
-
setIgnoreAllDefaultArgs
Iftrue, Playwright does not pass its own configurations args and only uses the ones fromargs. Dangerous option; use with care. Defaults tofalse. -
setIgnoreDefaultArgs
Iftrue, Playwright does not pass its own configurations args and only uses the ones fromargs. Dangerous option; use with care. -
setProxy
Network proxy settings. -
setProxy
Network proxy settings. -
setSlowMo
Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on. -
setTimeout
Maximum time in milliseconds to wait for the browser instance to start. Defaults to30000(30 seconds). Pass0to disable timeout. -
setTracesDir
If specified, traces are saved into this directory.
-