Interface LaunchOptions

Hierarchy

  • LaunchOptions

Properties

args?: string[]

NOTE Use custom browser args at your own risk, as some of them may break Playwright functionality.

Additional arguments to pass to the browser instance. The list of Chromium flags can be found here.

channel?: string

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?: boolean

Enable Chromium sandboxing. Defaults to false.

devtools?: boolean

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.

Deprecated

Use debugging tools instead.

downloadsPath?: string

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?: {
    [key: string]: string | number | boolean;
}

Specify environment variables that will be visible to the browser. Defaults to process.env.

Type declaration

  • [key: string]: string | number | boolean
executablePath?: string

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. Note that Playwright only works with the bundled Chromium, Firefox or WebKit, use at your own risk.

firefoxUserPrefs?: {
    [key: string]: string | number | boolean;
}

Firefox user preferences. Learn more about the Firefox user preferences at about:config.

Type declaration

  • [key: string]: string | number | boolean
handleSIGHUP?: boolean

Close the browser process on SIGHUP. Defaults to true.

handleSIGINT?: boolean

Close the browser process on Ctrl-C. Defaults to true.

handleSIGTERM?: boolean

Close the browser process on SIGTERM. Defaults to true.

headless?: boolean

Whether to run browser in headless mode. More details for Chromium and Firefox. Defaults to true unless the devtools option is true.

ignoreDefaultArgs?: boolean | string[]

If true, Playwright does not pass its own configurations args and only uses the ones from args. If an array is given, then filters out the given default arguments. Dangerous option; use with care. Defaults to false.

logger?: Logger

Logger sink for Playwright logging.

proxy?: {
    bypass?: string;
    password?: string;
    server: string;
    username?: string;
}

Network proxy settings.

Type declaration

  • Optional bypass?: string

    Optional comma-separated domains to bypass proxy, for example ".com, chromium.org, .domain.com".

  • Optional password?: string

    Optional password to use if HTTP proxy requires authentication.

  • server: string

    Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example http://myproxy.com:3128 or socks5://myproxy.com:3128. Short form myproxy.com:3128 is considered an HTTP proxy.

  • Optional username?: string

    Optional username to use if HTTP proxy requires authentication.

slowMo?: number

Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on.

timeout?: number

Maximum time in milliseconds to wait for the browser instance to start. Defaults to 30000 (30 seconds). Pass 0 to disable timeout.

tracesDir?: string

If specified, traces are saved into this directory.

Generated using TypeDoc