PlaywrightServerOptions Class

The options of a PlaywrightServer.

public sealed class PlaywrightServerOptions

Constructors

NameDescription
PlaywrightServerOptions()

PlaywrightServerOptions()

PlaywrightServerOptions.cs
public PlaywrightServerOptions()

No documentation is available.

Properties

NameDescription
AllowAnyClientVersionGets or sets whether the clients of another version of Playwright can connect. The protocol changes with each minor version of Playwright: by default, the server rejects the clients whose major and minor versions differ from PlaywrightServer.PlaywrightVersion (as the Playwright server does), with an HTTP 428 response.
BindAddressGets or sets the address the server listens on. The default is IPAddress.Loopback: only the local clients can connect.
BrowserNameGets or sets the name of the browser reported to the clients (browser.browserType().name()). The clients enable some features depending on it. The default is chromium.
DocumentLoaderGets or sets the loader of the documents and of the resources of the pages (see BrowsingContextOptions.DocumentLoader). The default is null: nothing is fetched from the network, the pages can only use the content set by page.setContent() and the responses of the routes (page.route()). Use DocumentLoader.Create to let the pages load any URL (the clients can then make the server send requests to any host: do not expose such a server to untrusted clients).
MaxConnectionsGets or sets the maximum number of simultaneous connections. The default is null: no limit. A client that connects while the limit is reached waits for a connection to close.
PathGets or sets the path of the WebSocket endpoint (the clients connect to ws://host:port/path). The default is /. Use an unguessable path to prevent the other users of the machine from connecting.
PortGets or sets the TCP port the server listens on. The default is 0: a free port is chosen (see PlaywrightServer.Port).
ScriptEngineOptionsGets or sets the options of the script engines of the browser contexts (one engine per browser context), e.g. the timeout of a script. The default is null: the default options.
UseSystemFontsGets or sets whether the pages can use the fonts installed on the machine (see BrowsingContextOptions.UseSystemFonts). The default is false: the pages use the fonts bundled with the library and their web fonts.

AllowAnyClientVersion

PlaywrightServerOptions.cs

Gets or sets whether the clients of another version of Playwright can connect. The protocol changes with each minor version of Playwright: by default, the server rejects the clients whose major and minor versions differ from PlaywrightServer.PlaywrightVersion (as the Playwright server does), with an HTTP 428 response.

public bool AllowAnyClientVersion { get; set; }

Property value

bool

Gets or sets the address the server listens on. The default is IPAddress.Loopback: only the local clients can connect.

public IPAddress BindAddress { get; set; }

Property value

IPAddress

Gets or sets the name of the browser reported to the clients (browser.browserType().name()). The clients enable some features depending on it. The default is chromium.

public string BrowserName { get; set; }

Property value

string

Gets or sets the loader of the documents and of the resources of the pages (see BrowsingContextOptions.DocumentLoader). The default is null: nothing is fetched from the network, the pages can only use the content set by page.setContent() and the responses of the routes (page.route()). Use DocumentLoader.Create to let the pages load any URL (the clients can then make the server send requests to any host: do not expose such a server to untrusted clients).

public DocumentLoader? DocumentLoader { get; set; }

Property value

DocumentLoader?

Gets or sets the maximum number of simultaneous connections. The default is null: no limit. A client that connects while the limit is reached waits for a connection to close.

public int? MaxConnections { get; set; }

Property value

int?

Gets or sets the path of the WebSocket endpoint (the clients connect to ws://host:port/path). The default is /. Use an unguessable path to prevent the other users of the machine from connecting.

public string Path { get; set; }

Property value

string

Gets or sets the TCP port the server listens on. The default is 0: a free port is chosen (see PlaywrightServer.Port).

public int Port { get; set; }

Property value

int

ScriptEngineOptions

PlaywrightServerOptions.cs

Gets or sets the options of the script engines of the browser contexts (one engine per browser context), e.g. the timeout of a script. The default is null: the default options.

public JavaScriptScriptEngineOptions? ScriptEngineOptions { get; set; }

Gets or sets whether the pages can use the fonts installed on the machine (see BrowsingContextOptions.UseSystemFonts). The default is false: the pages use the fonts bundled with the library and their web fonts.

public bool UseSystemFonts { get; set; }

Property value

bool