Skip to content

Conversation

@RaHehl
Copy link

@RaHehl RaHehl commented Oct 30, 2025

Add ability to pass LaunchOptions directly via ConnectOptions instead of manually constructing JSON headers.

The implementation automatically serializes launchOptions to the x-playwright-launch-options header when provided.

Motivation / Use case

When running the browser inside a container and connecting remotely (see Playwright docs: Remote connection with Docker), it’s currently cumbersome to specify the browser channel.

current:
connectOptions.headers.put("x-playwright-launch-options", "{\"channel\":\"msedge\"}");
which you have to discover first

Proposed API (Java)

browserType.connect("ws://localhost:3000/ws",
          new BrowserType.ConnectOptions().setLaunchOptions(
            new BrowserType.LaunchOptions().setChannel("msedge")));

Add ability to pass LaunchOptions directly via ConnectOptions instead of
manually constructing JSON headers. This provides a type-safe and convenient
way to specify launch options like browser channel when connecting to a
remote browser.

The implementation automatically serializes launchOptions to the
x-playwright-launch-options header when provided.
@RaHehl
Copy link
Author

RaHehl commented Oct 30, 2025

@microsoft-github-policy-service agree

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.

1 participant