Repository navigation
feat(extension): do not steal focus when connecting via token - #43500
Closed
roey ben arieh (roeybenarieh) wants to merge 1 commit into
Closed
roey ben arieh (roeybenarieh) wants to merge 1 commit into
roey ben arieh (roeybenarieh) wants to merge 1 commit into
Conversation
roey ben arieh (roeybenarieh)
force-pushed
the
feat-extension-focus-tab
branch
from
October 18, 2026 08:07
3a01a90 to
999a070
Compare
Author
|
@microsoft-github-policy-service agree |
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? |
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
connectToTabtakes an optionalfocusTabflag (defaulttrue). The connect page passesfalseonly in the token branch.