Skip to content

Conversation

@Skn0tt
Copy link
Member

@Skn0tt Skn0tt commented Jun 20, 2025

Second revision of the browser server sketch. It facilitates sharing browser amongst Playwright MCP, the VS Code Extension and CLI Clients like npx playwright open or npx playwright test.

Implemented using a new connection mode that's similar to "reuse browsers", but that doesn't close anything on connect. For now, you can only specify connect=first to get access to the first browser.

Demo still works the same as in the previous revision:

Screen.Recording.2025-06-16.at.15.01.37.mov

You can also do nxp playwright open with the PW_BROWSER_SERVER env var. There's no support in test runner yet.

See microsoft/playwright-mcp#579 and microsoft/playwright-vscode#647 for the other side of the demo.

@github-actions
Copy link
Contributor

Test results for "tests 1"

4 flaky ⚠️ [firefox-library] › library/inspector/cli-codegen-1.spec.ts:986:7 › cli codegen › should not throw csp directive violation errors @firefox-ubuntu-22.04-node18
⚠️ [playwright-test] › ui-mode-test-watch.spec.ts:145:5 › should watch all @ubuntu-latest-node22-1
⚠️ [webkit-page] › page/page-screenshot.spec.ts:345:5 › page screenshot › should work while navigating @webkit-ubuntu-22.04-node18
⚠️ [playwright-test] › ui-mode-test-watch.spec.ts:145:5 › should watch all @windows-latest-node18-1

39450 passed, 823 skipped
✔️✔️✔️

Merge workflow run.

Copy link
Contributor

@dgozman dgozman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's follow up with npx playwright open.


debugLogger.log('server', `[${id}] engaged connect mode`);

let browser = this._playwright.allBrowsers().find(b => b.options.name === browserName);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like we should compare launchOptions like we do for reuse.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that'd require MCP to know the launchOptions of the test runner. unsure if this is right

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.

2 participants