fix(mcp): identify downloads explicitly - #41933
Conversation
Chromium reports both downloads and renderer crashes as ERR_ABORTED. Wait for either event so crash recovery cannot race the next tool call. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0d6d0323-d581-4df1-ae11-bf2d9302c1d2
This comment has been minimized.
This comment has been minimized.
|
Hi, I'm the Playwright bot and I took a first look at the CI failures here. 🟢 The one failure is a pre-existing flake — this PR is clearThe single red test, DetailsPre-existing flake / infra
On the diff itself Worth noting your change does touch this exact code path — I'm a first pass, so treat the green as "no PR-caused failures found," not a guarantee the branch is bug-free. Triaged by the Playwright bot - agent run |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 296e429d-05c3-4f64-be3f-a199a1e00d65
Test results for "MCP"7786 passed, 1262 skipped Merge workflow run. |
## What's New ### Tool Improvements - **`browser_take_screenshot` — WebP format** — New `type` option to pick the image format (`png`, `jpeg` or `webp`); when unset, the format is inferred from the filename extension ([#41152](microsoft/playwright#41152)) - **`--codegen` — more languages** — Code generation now supports `python`, `java` and `csharp` in addition to `typescript` ([#42106](microsoft/playwright#42106)) - **Configurable settle delay** — New `--timeout-settle` flag (and `timeouts.settle` config option) to control how long to wait after each action for triggered work (navigations, requests) to settle, defaults to 500ms ([#41924](microsoft/playwright#41924)) ## Fixes - Aria snapshot capture is skipped when the response discards it ([#41923](microsoft/playwright#41923)) - New `--snapshot-boxes` flag (and `snapshot.boxes` config option) to enable bounding boxes in snapshots globally — previously this was only available per command ([#42102](microsoft/playwright#42102)) - Reconnect to the browser after a disconnect ([#41966](microsoft/playwright#41966)) - Report malformed JSON config instead of silently falling back to INI parsing ([#41909](microsoft/playwright#41909)) - Clear the dialog modal state when a dialog is closed out of band ([#42032](microsoft/playwright#42032)) - Detect downloads via the download event instead of guessing from `net::ERR_ABORTED` navigation errors ([#41933](microsoft/playwright#41933)) - Surface the missing executable path when a browser isn't installed ([#41941](microsoft/playwright#41941)) - Escape user input in codegen output ([#41962](microsoft/playwright#41962)) - Removed the stale `--output-mode` CLI option ([#41833](microsoft/playwright#41833)) ### Browser Extension - Validate `Host` and `Origin` headers on CDP relay WebSocket upgrades ([#42103](microsoft/playwright#42103)) - Launch the Chrome profile that has the extension installed ([#41939](microsoft/playwright#41939)) - Pass `noDefaults` for extension CDP connections ([#42119](microsoft/playwright#42119)) - Mention `PLAYWRIGHT_MCP_EXECUTABLE_PATH` in the error shown when the browser executable is not found ([#42122](microsoft/playwright#42122)) - Removed support for extension protocol v1 ([#41857](microsoft/playwright#41857))
This PR stops treating every Chromium
net::ERR_ABORTEDnavigation as a possible download. Since Chromium 140, released in September 2025,Page.navigatereports downloads explicitly, which Playwright surfaces asDownload is starting.Previously, MCP waited up to three seconds for a download event before returning
net::ERR_ABORTED. This didn’t change the result, but happened to give the renderer’scrashevent time to arrive. The error is now returned immediately. Crash recovery stays the same: once the event arrives, a subsequent MCP call resets the page toabout:blankand reportsPage crashed and was reset to about:blank.The crash tests now poll for recovery instead of relying on the download wait, and explicitly await the crash event when asserting tab state.