# `PlaywrightEx.Supervisor`
[🔗](https://github.com/probably-not/playwright_ex/blob/v0.5.0-fork.2/lib/playwright_ex/supervisor.ex#L1)

Playwright connection supervision tree.

Supports two transport modes:
- Local Port (default): Spawns Node.js playwright driver
- WebSocket: Connects to remote Playwright server

## Options
- `:ws_endpoint` - WebSocket URL (e.g. `ws://localhost:3000?browser=chromium`).
  If provided, uses WebSocket transport. Otherwise uses local Port.
  If no browser param is provided, `chromium` is used by default.
- `:executable` - Path to playwright CLI (only for Port transport)
- `:env` - A `%{String.t() => String.t()}` map of environment variables to set for the browser instance (only for Port transport).
- `:timeout` - Connection timeout
- `:js_logger` - Module for logging JS console messages
- `:name` - Optional name for this supervisor instance. Defaults to `PlaywrightEx.Supervisor`.
  Use this to run multiple independent Playwright connections (e.g., one with PortTransport,
  another with WebSocketTransport). The name is used to derive child process names.

## Limitations of WebSocket connection to remote server
- Single browser type - only the one you set via `ws_endpoint` (the browser type passed to `PlaywrightEx.launch_browser/2` is ignored)

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `connection_name`

Returns the connection process name for a given supervisor name.

# `start_link`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
