BrowserServer

Playwright\BrowserServer\BrowserServerInterface

Represents a remotely launched browser server. The server exposes a WebSocket endpoint for connecting Playwright clients. Lifecycle methods close or terminate the browser process behind that endpoint.

Methods

wsEndpoint()

string

Returns the WebSocket endpoint. Connect a Playwright client to this URL from another process. The endpoint remains valid while the server is running.

function wsEndpoint(): string

close()

void

Closes the browser server. Requests a graceful shutdown from the Playwright server process. Connected clients lose their browser connection once it completes.

function close(): void

kill()

void

Kills the browser server. Terminates the underlying browser process without a graceful shutdown. Connected clients lose their browser connection immediately.

function kill(): void

process()

?int

Returns the server process identifier. A null value means the process identifier is unavailable. The identifier can be used for operating-system level diagnostics.

function process(): ?int