Skip to content

fix(mcp): disable the chromium sandbox for the bundled browser on linux - #42490

Merged
Yury Semikhatsky (yury-s) merged 1 commit into
microsoft:mainfrom
yury-s:fix-42452
Sep 1, 2026
Merged

fix(mcp): disable the chromium sandbox for the bundled browser on linux#42490
Yury Semikhatsky (yury-s) merged 1 commit into
microsoft:mainfrom
yury-s:fix-42452

Conversation

@yury-s

Copy link
Copy Markdown
Member

Summary

  • An undefined channel with browserName: 'chromium' resolves to the same downloaded build as the chromium and chrome-for-testing channels, so treat it the same when defaulting chromiumSandbox on linux.

Fixes #42452

An explicit browserName 'chromium' without a channel launches the same
downloaded build as the 'chromium' and 'chrome-for-testing' channels,
which has no setuid sandbox helper on linux.

Fixes: microsoft#42452
if (process.platform === 'linux') {
// Downloaded chromium builds (undefined channel, 'chromium', 'chrome-for-testing') lack the setuid sandbox helper on linux.
const { channel } = browser.launchOptions;
browser.launchOptions.chromiumSandbox = channel !== undefined && channel !== 'chromium' && channel !== 'chrome-for-testing';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

channel !== 'chrome-for-testing' <-- I would kick this out.

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.

It's in the same category. The downloaded builds ship chrome_sandbox, but it's extracted from a zip as -rwxr-xr-x user user and archives can't carry setuid root.

@yury-s
Yury Semikhatsky (yury-s) merged commit 03a69df into microsoft:main Sep 1, 2026
16 of 17 checks passed
@yury-s
Yury Semikhatsky (yury-s) deleted the fix-42452 branch September 1, 2026 18:08
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Test results for "MCP"

1 failed
❌ [firefox] › mcp/cli-core.spec.ts:97 › fill @mcp-windows-latest-firefox

8307 passed, 1377 skipped


Merge workflow run.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Hi, I'm the Playwright bot and I took a first look at the CI failure here.

🟢 The one failure is a pre-existing flake — this PR is clear

The single red is [firefox] › mcp/cli-core.spec.ts:97 › fill on mcp-windows-latest-firefox. This PR only changes how chromiumSandbox defaults for downloaded Chromium builds on Linux — it can't affect a Firefox MCP test on Windows. And the same test failed on a non-PR push (SHA d529911d, 2026-07-28) with the identical error, so it predates your change.

Details

Pre-existing flake / infra

  • [firefox] › mcp/cli-core.spec.ts:97 › fill — Windows-Firefox-only flake. Across the test-results DB this test is green almost everywhere: mcp-windows-latest-firefox 2 failed / 694 runs, and 0 failures on the ubuntu (701 runs) and macOS (707 runs) bots. Crucially, one of those two failures was run 30317255877 on SHA d529911d (a push, not this PR), with the exact same assertion:

    expect(received).toBe(expected)
    Expected: "- textbox [active] [ref=e2]: Hello, world!"
    Received: undefined
    

    The snapshot occasionally comes back without the filled textbox on Windows-Firefox. This PR touches only packages/playwright-core/src/tools/mcp/config.ts (chromiumSandbox defaulting for chromium/chrome-for-testing/undefined channels on Linux) and a Linux-gated test — nothing in the Firefox fill/snapshot path.

Triaged by the Playwright bot - agent 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.

[Bug]: MCP config enables the chromium sandbox for the bundled browser on linux

2 participants