playwright-java icon indicating copy to clipboard operation
playwright-java copied to clipboard

feat(api): add launchOptions support to ConnectOptions

Open RaHehl opened this issue 1 month ago • 1 comments

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")));

RaHehl avatar Oct 30 '25 12:10 RaHehl

@microsoft-github-policy-service agree

RaHehl avatar Oct 30 '25 12:10 RaHehl