BrowserBuilder

Playwright\Browser\BrowserBuilder

Methods

__construct()

function __construct( private readonly string $browserType, private readonly TransportInterface $transport, private readonly LoggerInterface $logger, private readonly PlaywrightConfig $config, )

withHeadless()

self
function withHeadless(bool $headless = true): self

withSlowMo()

self
function withSlowMo(int $milliseconds): self

withChannel()

self
function withChannel(string $channel): self

withProxy()

self
function withProxy(array $proxy): self

withDownloadsPath()

self
function withDownloadsPath(string $path): self

withArgs()

self
function withArgs(array $args): self

withInspector()

self
function withInspector(): self

launch()

BrowserInterface
function launch(): BrowserInterface

connect()

BrowserInterface

Attaches Playwright to an existing BrowserServer via WebSocket endpoint.

function connect(string $wsEndpoint, array $options = []): BrowserInterface

connectOverCDP()

BrowserInterface

Attaches Playwright over CDP (Chromium only).

function connectOverCDP(string $endpointURL, array $options = []): BrowserInterface