Skip to content

feat(extension): do not steal focus when connecting via token - #43500

Closed
roey ben arieh (roeybenarieh) wants to merge 1 commit into
microsoft:mainfrom
roeybenarieh:feat-extension-focus-tab
Closed

roey ben arieh (roeybenarieh) wants to merge 1 commit into
microsoft:mainfrom
roeybenarieh:feat-extension-focus-tab

Conversation

@roeybenarieh

@roeybenarieh roey ben arieh (roeybenarieh) commented Oct 17, 2026 •

Copy link
Copy Markdown

Summary

When the extension connects through the token bypass (PLAYWRIGHT_MCP_EXTENSION_TOKEN), it no longer activates the tab or focuses its window. Connecting through the tab dialog is unchanged: the tab the user picks is still activated.

Why

With a token there is no dialog and no user choice, so bringing Chrome to the front is unexpected. I run Playwright MCP in extension mode with a token while working in another tab or app, and every agent connect pulls my focus away.

This follows the review on microsoft/playwright-mcp#1471: suppressing focus makes sense only when the user did not pick the tab, so the option is applied only in the token path.

Implementation

connectToTab takes an optional focusTab flag (default true). The connect page passes false only in the token branch.

@roeybenarieh roey ben arieh (roeybenarieh) changed the title feat(extension): add option to connect without focusing the tab feat(extension): do not steal focus when connecting via token Oct 18, 2026
@roeybenarieh

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@roeybenarieh

Copy link
Copy Markdown
Author

Yury Semikhatsky (@yury-s) this is a follow-up to your review of microsoft/playwright-mcp#1471. It takes your suggestion: only the token path skips activating the tab, and the dialog path still activates the tab the user picked. Could you take a look when you have a chance?

@yury-s

Copy link
Copy Markdown
Member

This still brings the browser to the top. We are working on a better fix as part of #42973 that requires upstream changes in Chromium to be rolled out first.

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