Skip to content

chore: show mcp-owned browsers#684

Merged
Skn0tt merged 14 commits intomicrosoft:mainfrom
Skn0tt:mcp-connection
Sep 8, 2025
Merged

chore: show mcp-owned browsers#684
Skn0tt merged 14 commits intomicrosoft:mainfrom
Skn0tt:mcp-connection

Conversation

@Skn0tt
Copy link
Member

@Skn0tt Skn0tt commented Sep 1, 2025

Scans vscode.lm.tools for Playwright MCP instances, and calls the browser_connect tool to establish a DebugController connection with them. microsoft/playwright-mcp#979 shows its implementation.
These debug controllers can then be shown from the browser list, just like the test-runner controlled debug controllers.

@Skn0tt Skn0tt requested a review from dgozman September 1, 2025 13:33
@Skn0tt Skn0tt self-assigned this Sep 1, 2025
Skn0tt added a commit to microsoft/playwright-mcp that referenced this pull request Sep 2, 2025
this._pageCountChanged(params.pageCount);
this._onPageCountChangedEvent.fire(this.pageCount());

if (backend === this._backend) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this logic now? It was not present before.

Copy link
Member Author

@Skn0tt Skn0tt Sep 3, 2025

Choose a reason for hiding this comment

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

We had it, it was in this._pageCountChanged().

@Skn0tt Skn0tt requested a review from dgozman September 3, 2025 11:57
this._backend = undefined;
if (backend === this._testingBackend) {
this._testingBackend = undefined;
void this._reset('none');
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this logic should later apply to the "currently recording backend", once you implement recording in all backends.

void this._vscode.window.showErrorMessage(e.message);
this._backend = undefined;
this._testingBackend = undefined;
void this._reset('none');
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here.

private async _startBackendIfNeeded(model: TestModel): Promise<{ errors?: string[] }> {
// Unconditionally close selector dialog, it might send inspect(enabled: false).
if (this._backend) {
if (this._testingBackend) {
Copy link
Contributor

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 making this piece understandable, as discussed offline.

@Skn0tt Skn0tt requested a review from dgozman September 8, 2025 12:37
void this._vscode.window.showErrorMessage(e.message);
this._backend = undefined;
void this._reset('none');
void this._reset('none', this._testingBackend);
Copy link
Contributor

Choose a reason for hiding this comment

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

It feels like this call should be inside the handler on the line 147 instead. Same goes for lines 115 and 143.

Copy link
Member Author

Choose a reason for hiding this comment

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

For onError, maybe. But not for onClose, since the extension doesn't control the MCP lifecycle. I'll revisit this once I implement recording for MCP.

@Skn0tt Skn0tt merged commit d1f0c31 into microsoft:main Sep 8, 2025
7 checks passed
Skn0tt added a commit to Skn0tt/playwright-vscode that referenced this pull request Oct 1, 2025
lucim23 pushed a commit to lucim23/playwright-mcp that referenced this pull request Feb 5, 2026
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