Skip to content

chore: prevent launching more browsers in server mode - #36353

Merged
Simon Knott (Skn0tt) merged 7 commits into
microsoft:mainfrom
Skn0tt:forbid-launching-second-browers
Jun 19, 2025
Merged

chore: prevent launching more browsers in server mode#36353
Simon Knott (Skn0tt) merged 7 commits into
microsoft:mainfrom
Skn0tt:forbid-launching-second-browers

Conversation

@Skn0tt

Copy link
Copy Markdown
Member

No description provided.

Comment thread packages/playwright-core/src/server/dispatchers/playwrightDispatcher.ts Outdated
const remoteServer = await startRemoteServer('launchServer');
const browser = await connect(remoteServer.wsEndpoint()) as any as BrowserImpl;
await expect(
browser._connection.sendMessageToServer(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think it's easier to call browser._parent.launch(), then you won't need the guid as well.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

fabulous!

Comment thread packages/playwright-core/src/browserServerImpl.ts Outdated
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

const browser = await playwright[browserName as 'chromium'].launch(serverSideCallMetadata(), this._options.launchOptions);
browser.options.sdkLanguage = options.sdkLanguage;

this._cleanups.push(async () => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think we still need to close browser though.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

1 failed
❌ [webkit-library] › library/video.spec.ts:441:5 › screencast › should work for popups @webkit-ubuntu-22.04-node18

3 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
⚠️ [firefox-page] › page/page-wait-for-function.spec.ts:104:3 › should work with strict CSP policy @firefox-ubuntu-22.04-node18
⚠️ [playwright-test] › ui-mode-test-watch.spec.ts:145:5 › should watch all @windows-latest-node18-1

39429 passed, 822 skipped
✔️✔️✔️

Merge workflow run.

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