Skip to content

feat(mcp): accept ConnectOptions object for remoteEndpoint#40964

Open
adityasingh2400 wants to merge 1 commit into
microsoft:mainfrom
adityasingh2400:fix-40478
Open

feat(mcp): accept ConnectOptions object for remoteEndpoint#40964
adityasingh2400 wants to merge 1 commit into
microsoft:mainfrom
adityasingh2400:fix-40478

Conversation

@adityasingh2400
Copy link
Copy Markdown

Summary

  • remoteEndpoint was a plain URL string, so there was no way to forward exposeNetwork, headers, slowMo, or timeout when connecting to a remote browser. exposeNetwork: '<loopback>' is the standard way to let the remote browser reach localhost on the client (via SOCKS tunneling), and is what the test runner already supports via connectOptions in playwright.config.ts.
  • Accept string | playwright.ConnectOptions & { endpoint: string } per @dgozman's suggestion on the original attempt. The string form keeps existing behavior; the object form is normalized inside createRemoteBrowser and passed straight through to connectToBrowser.

Fixes #40478

The CLI / MCP config exposed `remoteEndpoint` as a plain URL string, so
there was no way to forward `exposeNetwork`, `headers`, `slowMo`, or
`timeout` when connecting to a remote browser. The test runner already
accepts a `connectOptions` object via `playwright.config.ts`; this brings
the same surface to the MCP config.

`remoteEndpoint` now accepts `string | playwright.ConnectOptions & {
endpoint: string }`. The string form keeps the existing behavior. The
object form is normalized inside `createRemoteBrowser` and forwarded to
`connectToBrowser`, so the underlying connect call receives the full set
of options including `exposeNetwork: '<loopback>'` for SOCKS tunneling
back to the client.

Fixes: microsoft#40478
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] exposeNetwork not supported for remote browser connections in CLI config

1 participant