Table of Contents

Class BrowserTypeLaunchOptions

Namespace
Microsoft.Playwright
Assembly
Microsoft.Playwright.dll
public class BrowserTypeLaunchOptions
Inheritance
BrowserTypeLaunchOptions
Inherited Members

Constructors

BrowserTypeLaunchOptions()

public BrowserTypeLaunchOptions()

BrowserTypeLaunchOptions(BrowserTypeLaunchOptions)

public BrowserTypeLaunchOptions(BrowserTypeLaunchOptions clone)

Parameters

clone BrowserTypeLaunchOptions

Properties

Args

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

[JsonPropertyName("args")]
public IEnumerable<string>? Args { get; set; }

Property Value

IEnumerable<string>

Remarks

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

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.

[JsonPropertyName("channel")]
public string? Channel { get; set; }

Property Value

string

ChromiumSandbox

Enable Chromium sandboxing. Defaults to false.

[JsonPropertyName("chromiumSandbox")]
public bool? ChromiumSandbox { get; set; }

Property Value

bool?

Devtools

**DEPRECATED** Use debugging tools instead.

**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.

[JsonPropertyName("devtools")]
[Obsolete]
public bool? Devtools { get; set; }

Property Value

bool?

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.

[JsonPropertyName("downloadsPath")]
public string? DownloadsPath { get; set; }

Property Value

string

Env

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

[JsonPropertyName("env")]
public IEnumerable<KeyValuePair<string, string>>? Env { get; set; }

Property Value

IEnumerable<KeyValuePair<string, string>>

ExecutablePath

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.

[JsonPropertyName("executablePath")]
public string? ExecutablePath { get; set; }

Property Value

string

FirefoxUserPrefs

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

[JsonPropertyName("firefoxUserPrefs")]
public IEnumerable<KeyValuePair<string, object>>? FirefoxUserPrefs { get; set; }

Property Value

IEnumerable<KeyValuePair<string, object>>

HandleSIGHUP

Close the browser process on SIGHUP. Defaults to true.

[JsonPropertyName("handleSIGHUP")]
public bool? HandleSIGHUP { get; set; }

Property Value

bool?

HandleSIGINT

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

[JsonPropertyName("handleSIGINT")]
public bool? HandleSIGINT { get; set; }

Property Value

bool?

HandleSIGTERM

Close the browser process on SIGTERM. Defaults to true.

[JsonPropertyName("handleSIGTERM")]
public bool? HandleSIGTERM { get; set; }

Property Value

bool?

Headless

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

[JsonPropertyName("headless")]
public bool? Headless { get; set; }

Property Value

bool?

IgnoreAllDefaultArgs

If true, Playwright does not pass its own configurations args and only uses the ones from args. Dangerous option; use with care. Defaults to false.

[JsonPropertyName("ignoreAllDefaultArgs")]
public bool? IgnoreAllDefaultArgs { get; set; }

Property Value

bool?

IgnoreDefaultArgs

If true, Playwright does not pass its own configurations args and only uses the ones from args. Dangerous option; use with care.

[JsonPropertyName("ignoreDefaultArgs")]
public IEnumerable<string>? IgnoreDefaultArgs { get; set; }

Property Value

IEnumerable<string>

Proxy

Network proxy settings.

[JsonPropertyName("proxy")]
public Proxy? Proxy { get; set; }

Property Value

Proxy

SlowMo

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

[JsonPropertyName("slowMo")]
public float? SlowMo { get; set; }

Property Value

float?

Timeout

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

[JsonPropertyName("timeout")]
public float? Timeout { get; set; }

Property Value

float?

TracesDir

If specified, traces are saved into this directory.

[JsonPropertyName("tracesDir")]
public string? TracesDir { get; set; }

Property Value

string