Repository navigation
fix(mcp): rebind page-registered WebMCP tools when the tab or frame changes - #42821
Conversation
…hanges The dynamic tool list was only replaced when the tool schemas changed, so handlers stayed bound to a detached frame after a reload, or to the previous tab when two tabs exposed the same tools. Fixes microsoft#42816
| const tools = this._currentTab?.webmcpTools()?.tools.map(tool => tool.mcpTool) ?? []; | ||
| // Handlers are bound to the tab and frame they were listed from, so always take | ||
| // the fresh ones. Only the listChanged notification depends on the schemas. | ||
| this._webmcpTools = tools; |
There was a problem hiding this comment.
A cleaner variant is to drop Context._webmcpTools and have currentWebMCPTools() read from _currentTab?.webmcpTools().
Dmitry Gozman (@dgozman) what do you think?
| }); | ||
| }); | ||
|
|
||
| test('a tool with the same name in two tabs runs in the current tab', async ({ startClient, server, mcpBrowser }) => { |
There was a problem hiding this comment.
just one test above is sufficient, drop this
|
|
||
| maybeNotifyWebMCPToolsChanged() { | ||
| const tools = this._currentTab?.webmcpTools()?.tools.map(tool => tool.mcpTool) ?? []; | ||
| // Handlers are bound to the tab and frame they were listed from, so always take |
There was a problem hiding this comment.
Shorten the comment or drop it entirely: "// Handlers are bound to a tab and frame, always take the fresh ones."
|
|
||
| maybeNotifyWebMCPToolsChanged() { | ||
| const tools = this._currentTab?.webmcpTools()?.tools.map(tool => tool.mcpTool) ?? []; | ||
| // Handlers are bound to the tab and frame they were listed from, so always take |
There was a problem hiding this comment.
Shorten the comment or drop it entirely: "// Handlers are bound to a tab and frame, always take the fresh ones."
This comment has been minimized.
This comment has been minimized.
Address review: drop the cached tool list on Context, keep only the schema signature for listChanged notifications, drop the redundant two-tab test and skip the iframe test on Firefox, which does not list tools registered in iframes.
|
Pushed a follow-up addressing the comments:
|
This comment has been minimized.
This comment has been minimized.
|
AbNoZ&v02 (@Abnoz01) |
|
Took a look. The same test failed the same way on #42818 (injected regex change only), and the CI results db shows all three iframe tests in I merged main into the branch to get a fresh run. Happy to send a separate PR that waits for the iframe's tools to show up before asserting, if that helps. |
Test results for "MCP"1 failed 8698 passed, 1480 skipped Merge workflow run. |
Dmitry Gozman (dgozman)
left a comment
There was a problem hiding this comment.
Looks good to me, thank you for the fix!
0c0594d
into
microsoft:main
## ✨ Highlights - **🔎 Save `browser_find` results to a file** — new `filename` parameter writes matches to a file instead of the response ([microsoft/playwright#42077](microsoft/playwright#42077)). ([microsoft/playwright#42968](microsoft/playwright#42968)) ## 🐛 Fixes - `browser_navigate` and `browser_reload` report a dialog opened during page load instead of timing out ([microsoft/playwright#42817](microsoft/playwright#42817)). ([microsoft/playwright#42908](microsoft/playwright#42908)) - The server no longer crashes when the browser is closed during a download ([microsoft/playwright#42831](microsoft/playwright#42831)). ([microsoft/playwright#42922](microsoft/playwright#42922)) - `browser_wait_for` reports when `time` is capped at 30 seconds ([#1767](#1767)). ([microsoft/playwright#42932](microsoft/playwright#42932)) - WebMCP tools no longer stay bound to a stale tab or frame ([microsoft/playwright#42816](microsoft/playwright#42816)). ([microsoft/playwright#42821](microsoft/playwright#42821)) - WebMCP tool calls work with Chromium 155+. ([microsoft/playwright#42915](microsoft/playwright#42915)) - Snapshots quote accessible names that look like regexes, e.g. `"/home/"` ([microsoft/playwright#42807](microsoft/playwright#42807)). ([microsoft/playwright#42811](microsoft/playwright#42811)) - The Docker image reaps orphaned browser processes ([#1769](#1769)). ([#1771](#1771))
## Fixes - `run-code` scripts can use timers, `fetch`, `URL`, `Buffer`, `crypto`, `AbortController` and `TextEncoder`/`TextDecoder`; `require` and `process` stay unavailable ([#471](#471)). ([microsoft/playwright#42975](microsoft/playwright#42975)) - `find --filename=results.md` saves matches to a file when a query produces too many of them ([microsoft/playwright#42077](microsoft/playwright#42077)). ([microsoft/playwright#42968](microsoft/playwright#42968)) - `goto` and `reload` report a dialog opened during page load instead of timing out ([microsoft/playwright#42817](microsoft/playwright#42817)). ([microsoft/playwright#42908](microsoft/playwright#42908)) - The session no longer crashes when the browser is closed during a download ([microsoft/playwright#42831](microsoft/playwright#42831)). ([microsoft/playwright#42922](microsoft/playwright#42922)) - `install-browser --no-shell` is accepted instead of failing with `Unknown option: --shell` ([microsoft/playwright#42804](microsoft/playwright#42804)). ([microsoft/playwright#42871](microsoft/playwright#42871)) - `webmcp-call` no longer runs a tool in a stale tab or frame ([microsoft/playwright#42816](microsoft/playwright#42816)). ([microsoft/playwright#42821](microsoft/playwright#42821)) - `webmcp-call` works with Chromium 155+. ([microsoft/playwright#42915](microsoft/playwright#42915)) - Snapshots quote accessible names that look like regexes, e.g. `"/home/"` ([microsoft/playwright#42807](microsoft/playwright#42807)). ([microsoft/playwright#42811](microsoft/playwright#42811)) - The bundled skill only preapproves Playwright commands instead of any `npm` and `npx` command ([microsoft/playwright#42745](microsoft/playwright#42745)). ([microsoft/playwright#42789](microsoft/playwright#42789))
This PR contains the following updates: | Package | Type | Update | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---|---|---| | [aqua:astral-sh/uv](https://redirect.github.com/astral-sh/uv) | tools | patch | `0.12.19` → `0.12.20` |  |  | | [npm:@playwright/mcp](https://playwright.dev) ([source](https://redirect.github.com/microsoft/playwright-mcp)) | tools | patch | `0.0.82` → `0.0.83` |  |  | --- ### Release Notes <details> <summary>astral-sh/uv (aqua:astral-sh/uv)</summary> ### [`v0.12.20`](https://redirect.github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#01220) [Compare Source](https://redirect.github.com/astral-sh/uv/compare/0.12.19...0.12.20) Released on 2026-09-28. ##### Enhancements - Reuse lockfiles when dependency declarations are semantically equivalent ([#​21951](https://redirect.github.com/astral-sh/uv/pull/21951)) - Preserve second-line encoding declarations when installing wheel scripts with CRLF shebangs ([#​21990](https://redirect.github.com/astral-sh/uv/pull/21990)) ##### Preview features - Write normalized requirement declarations with the `lockfile-normalization` preview feature ([#​21951](https://redirect.github.com/astral-sh/uv/pull/21951)) - Honor synthetic default groups when installing or syncing from `pylock.toml` ([#​22003](https://redirect.github.com/astral-sh/uv/pull/22003)) - Resolve local paths in exported `pylock.toml` files relative to the output file ([#​22042](https://redirect.github.com/astral-sh/uv/pull/22042)) - Install each package only once when repeated `tool-install-locks` requirements resolve to the same package ([#​22000](https://redirect.github.com/astral-sh/uv/pull/22000)) - Reuse `lock-without-metadata` lockfiles for conflicting groups with distinct base and extra requirement specifiers ([#​22055](https://redirect.github.com/astral-sh/uv/pull/22055)) - Use consistent root-package paths in `uv workspace metadata` and `uv tree --format json` output ([#​22050](https://redirect.github.com/astral-sh/uv/pull/22050)) ##### Configuration - Continue searching `XDG_CONFIG_DIRS` after empty entries ([#​21987](https://redirect.github.com/astral-sh/uv/pull/21987)) ##### Performance - Restore the previous HTTP cache-write scheduling while investigating severe cache-revalidation stalls on ext4 filesystems ([#​22051](https://redirect.github.com/astral-sh/uv/pull/22051)) ##### Bug fixes - Apply hash constraints to every repeated requirement under `--require-hashes` and `--verify-hashes` ([#​21996](https://redirect.github.com/astral-sh/uv/pull/21996)) - Allow metadata builds for first-party workspace projects under `--no-build` ([#​21988](https://redirect.github.com/astral-sh/uv/pull/21988)) - Honor project exclusion flags with `--all-packages`, including `--no-install-project` and `--no-emit-project` ([#​21994](https://redirect.github.com/astral-sh/uv/pull/21994)) - Restore `pyproject.toml` if `uv upgrade` fails or is interrupted ([#​21983](https://redirect.github.com/astral-sh/uv/pull/21983)) - Generate working Nushell activation scripts for relocatable virtual environments ([#​21979](https://redirect.github.com/astral-sh/uv/pull/21979)) - Prevent commands from running and changing state after displaying `--show-settings` ([#​21989](https://redirect.github.com/astral-sh/uv/pull/21989)) - Treat UTF-16 requirements files containing only a byte-order mark as empty ([#​21991](https://redirect.github.com/astral-sh/uv/pull/21991)) - Ignore unrecognized managed-Python implementation directories during `uv python list` and `uv python upgrade` instead of panicking ([#​22033](https://redirect.github.com/astral-sh/uv/pull/22033)) - Avoid panics and incorrect rewriting when managed Python sysconfig paths merely start with `/install` ([#​22036](https://redirect.github.com/astral-sh/uv/pull/22036)) - Report whitespace-only non-ASCII requirements as invalid instead of panicking ([#​22035](https://redirect.github.com/astral-sh/uv/pull/22035)) - Avoid a resolver panic when trace logging an always-false constraint ([#​22034](https://redirect.github.com/astral-sh/uv/pull/22034)) </details> <details> <summary>microsoft/playwright-mcp (npm:@​playwright/mcp)</summary> ### [`v0.0.83`](https://redirect.github.com/microsoft/playwright-mcp/releases/tag/v0.0.83) [Compare Source](https://redirect.github.com/microsoft/playwright-mcp/compare/v0.0.82...v0.0.83) #### Bug Fixes - `browser_find` takes `filename` to save matches to a file instead of the response ([microsoft/playwright#42077](https://redirect.github.com/microsoft/playwright/issues/42077)). ([microsoft/playwright#42968](https://redirect.github.com/microsoft/playwright/pull/42968)) - `browser_navigate` and `browser_reload` report a dialog opened during page load instead of timing out ([microsoft/playwright#42817](https://redirect.github.com/microsoft/playwright/issues/42817)). ([microsoft/playwright#42908](https://redirect.github.com/microsoft/playwright/pull/42908)) - The server no longer crashes when the browser is closed during a download ([microsoft/playwright#42831](https://redirect.github.com/microsoft/playwright/issues/42831)). ([microsoft/playwright#42922](https://redirect.github.com/microsoft/playwright/pull/42922)) - `browser_wait_for` reports when `time` is capped at 30 seconds ([#​1767](https://redirect.github.com/microsoft/playwright-mcp/issues/1767)). ([microsoft/playwright#42932](https://redirect.github.com/microsoft/playwright/pull/42932)) - WebMCP tools no longer stay bound to a stale tab or frame ([microsoft/playwright#42816](https://redirect.github.com/microsoft/playwright/issues/42816)). ([microsoft/playwright#42821](https://redirect.github.com/microsoft/playwright/pull/42821)) - WebMCP tool calls work with Chromium 155+. ([microsoft/playwright#42915](https://redirect.github.com/microsoft/playwright/pull/42915)) - Snapshots quote accessible names that look like regexes, e.g. `"/home/"` ([microsoft/playwright#42807](https://redirect.github.com/microsoft/playwright/issues/42807)). ([microsoft/playwright#42811](https://redirect.github.com/microsoft/playwright/pull/42811)) - The Docker image reaps orphaned browser processes ([#​1769](https://redirect.github.com/microsoft/playwright-mcp/issues/1769)). ([#​1771](https://redirect.github.com/microsoft/playwright-mcp/pull/1771)) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/soodoh/dotfiles). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xMTIuMCIsInVwZGF0ZWRJblZlciI6IjQ0LjExMi4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Adoption](https://docs.renovatebot.com/merge-confidence/) | [Passing](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---|---|---| | [@playwright/mcp](https://playwright.dev) ([source](https://redirect.github.com/microsoft/playwright-mcp)) | `0.0.82` → `0.0.83` |  |  |  |  | --- > [!WARNING] > Some dependencies could not be looked up. Check the warning logs for more information. --- ### Release Notes <details> <summary>microsoft/playwright-mcp (@​playwright/mcp)</summary> ### [`v0.0.83`](https://redirect.github.com/microsoft/playwright-mcp/releases/tag/v0.0.83) [Compare Source](https://redirect.github.com/microsoft/playwright-mcp/compare/v0.0.82...v0.0.83) #### Bug Fixes - `browser_find` takes `filename` to save matches to a file instead of the response ([microsoft/playwright#42077](https://redirect.github.com/microsoft/playwright/issues/42077)). ([microsoft/playwright#42968](https://redirect.github.com/microsoft/playwright/pull/42968)) - `browser_navigate` and `browser_reload` report a dialog opened during page load instead of timing out ([microsoft/playwright#42817](https://redirect.github.com/microsoft/playwright/issues/42817)). ([microsoft/playwright#42908](https://redirect.github.com/microsoft/playwright/pull/42908)) - The server no longer crashes when the browser is closed during a download ([microsoft/playwright#42831](https://redirect.github.com/microsoft/playwright/issues/42831)). ([microsoft/playwright#42922](https://redirect.github.com/microsoft/playwright/pull/42922)) - `browser_wait_for` reports when `time` is capped at 30 seconds ([#​1767](https://redirect.github.com/microsoft/playwright-mcp/issues/1767)). ([microsoft/playwright#42932](https://redirect.github.com/microsoft/playwright/pull/42932)) - WebMCP tools no longer stay bound to a stale tab or frame ([microsoft/playwright#42816](https://redirect.github.com/microsoft/playwright/issues/42816)). ([microsoft/playwright#42821](https://redirect.github.com/microsoft/playwright/pull/42821)) - WebMCP tool calls work with Chromium 155+. ([microsoft/playwright#42915](https://redirect.github.com/microsoft/playwright/pull/42915)) - Snapshots quote accessible names that look like regexes, e.g. `"/home/"` ([microsoft/playwright#42807](https://redirect.github.com/microsoft/playwright/issues/42807)). ([microsoft/playwright#42811](https://redirect.github.com/microsoft/playwright/pull/42811)) - The Docker image reaps orphaned browser processes ([#​1769](https://redirect.github.com/microsoft/playwright-mcp/issues/1769)). ([#​1771](https://redirect.github.com/microsoft/playwright-mcp/pull/1771)) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/paulnsorensen/dotfiles). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xMTIuMCIsInVwZGF0ZWRJblZlciI6IjQ0LjExMi4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Claude (dep-harvest) <paulnsorensen@gmail.com> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
## ✨ Highlights - **🔎 Save `browser_find` results to a file** — new `filename` parameter writes matches to a file instead of the response ([microsoft/playwright#42077](microsoft/playwright#42077)). ([microsoft/playwright#42968](microsoft/playwright#42968)) ## 🐛 Fixes - `browser_navigate` and `browser_reload` report a dialog opened during page load instead of timing out ([microsoft/playwright#42817](microsoft/playwright#42817)). ([microsoft/playwright#42908](microsoft/playwright#42908)) - The server no longer crashes when the browser is closed during a download ([microsoft/playwright#42831](microsoft/playwright#42831)). ([microsoft/playwright#42922](microsoft/playwright#42922)) - `browser_wait_for` reports when `time` is capped at 30 seconds ([microsoft#1767](microsoft#1767)). ([microsoft/playwright#42932](microsoft/playwright#42932)) - WebMCP tools no longer stay bound to a stale tab or frame ([microsoft/playwright#42816](microsoft/playwright#42816)). ([microsoft/playwright#42821](microsoft/playwright#42821)) - WebMCP tool calls work with Chromium 155+. ([microsoft/playwright#42915](microsoft/playwright#42915)) - Snapshots quote accessible names that look like regexes, e.g. `"/home/"` ([microsoft/playwright#42807](microsoft/playwright#42807)). ([microsoft/playwright#42811](microsoft/playwright#42811)) - The Docker image reaps orphaned browser processes ([microsoft#1769](microsoft#1769)). ([microsoft#1771](microsoft#1771))
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [@openai/codex](https://redirect.github.com/openai/codex) ([source](https://redirect.github.com/openai/codex/tree/HEAD/codex-cli)) | [`0.159.2` → `0.160.1`](https://renovatebot.com/diffs/npm/@openai%2fcodex/0.159.2/0.160.1) |  |  | | [@playwright/mcp](https://playwright.dev) ([source](https://redirect.github.com/microsoft/playwright-mcp)) | [`0.0.80` → `0.0.83`](https://renovatebot.com/diffs/npm/@playwright%2fmcp/0.0.80/0.0.83) |  |  | | @​xai-official/grok | [`1.0.29` → `1.0.49`](https://renovatebot.com/diffs/npm/@xai-official%2fgrok/1.0.29/1.0.49) |  |  | | opencode-ai | [`1.18.30` → `1.18.34`](https://renovatebot.com/diffs/npm/opencode-ai/1.18.30/1.18.34) |  |  | --- ### Release Notes <details> <summary>openai/codex (@​openai/codex)</summary> ### [`v0.160.1`](https://redirect.github.com/openai/codex/compare/rust-v0.160.0-alpha.6.1...rust-v0.160.1) ### [`v0.160.0`](https://redirect.github.com/openai/codex/compare/rust-v0.159.3...rust-v0.160.0-alpha.6.1) ### [`v0.159.3`](https://redirect.github.com/openai/codex/compare/rust-v0.159.2...rust-v0.159.3) </details> <details> <summary>microsoft/playwright-mcp (@​playwright/mcp)</summary> ### [`v0.0.83`](https://redirect.github.com/microsoft/playwright-mcp/releases/tag/v0.0.83) [Compare Source](https://redirect.github.com/microsoft/playwright-mcp/compare/v0.0.82...v0.0.83) #### Bug Fixes - `browser_find` takes `filename` to save matches to a file instead of the response ([microsoft/playwright#42077](https://redirect.github.com/microsoft/playwright/issues/42077)). ([microsoft/playwright#42968](https://redirect.github.com/microsoft/playwright/pull/42968)) - `browser_navigate` and `browser_reload` report a dialog opened during page load instead of timing out ([microsoft/playwright#42817](https://redirect.github.com/microsoft/playwright/issues/42817)). ([microsoft/playwright#42908](https://redirect.github.com/microsoft/playwright/pull/42908)) - The server no longer crashes when the browser is closed during a download ([microsoft/playwright#42831](https://redirect.github.com/microsoft/playwright/issues/42831)). ([microsoft/playwright#42922](https://redirect.github.com/microsoft/playwright/pull/42922)) - `browser_wait_for` reports when `time` is capped at 30 seconds ([#​1767](https://redirect.github.com/microsoft/playwright-mcp/issues/1767)). ([microsoft/playwright#42932](https://redirect.github.com/microsoft/playwright/pull/42932)) - WebMCP tools no longer stay bound to a stale tab or frame ([microsoft/playwright#42816](https://redirect.github.com/microsoft/playwright/issues/42816)). ([microsoft/playwright#42821](https://redirect.github.com/microsoft/playwright/pull/42821)) - WebMCP tool calls work with Chromium 155+. ([microsoft/playwright#42915](https://redirect.github.com/microsoft/playwright/pull/42915)) - Snapshots quote accessible names that look like regexes, e.g. `"/home/"` ([microsoft/playwright#42807](https://redirect.github.com/microsoft/playwright/issues/42807)). ([microsoft/playwright#42811](https://redirect.github.com/microsoft/playwright/pull/42811)) - The Docker image reaps orphaned browser processes ([#​1769](https://redirect.github.com/microsoft/playwright-mcp/issues/1769)). ([#​1771](https://redirect.github.com/microsoft/playwright-mcp/pull/1771)) ### [`v0.0.82`](https://redirect.github.com/microsoft/playwright-mcp/releases/tag/v0.0.82) [Compare Source](https://redirect.github.com/microsoft/playwright-mcp/compare/v0.0.81...v0.0.82) #### ✨ Highlights - **🎬 Smooth 60 fps, styleable videos** — `browser_start_video` (opt-in via `--caps=devtools`) takes `fps`, so `fps: 60` records smooth 60 fps videos instead of the default 25, and `cursor: true` renders an animated mouse cursor that travels to each action point and stays visible between actions. `browser_video_show_actions` takes a `style` with `point`, `highlight` and `title` CSS declarations; the action point marker and the target highlight are now only shown when styled. ([microsoft/playwright#42752](https://redirect.github.com/microsoft/playwright/pull/42752), [microsoft/playwright#42758](https://redirect.github.com/microsoft/playwright/pull/42758)) - **🧰 WebMCP tools become real MCP tools** — the tools a page registers through the [WebMCP](https://webmachinelearning.github.io/webmcp/) API now show up right in the tool list as `webmcp_<tool>`, with the page's own input schema and annotations, so an agent can call them directly and let the page do the work instead of driving its UI. The list follows the current tab, and clients get a `tools/list_changed` notification when it changes. This replaces `browser_webmcp_list` / `browser_webmcp_call` from v0.0.81, which are no longer exposed over MCP. Tool names, descriptions, schemas and results come from the page, so treat them as untrusted input. Pass `--no-webmcp` (config `webmcp: false`, env `PLAYWRIGHT_MCP_WEBMCP=false`) to opt out. WebMCP is experimental, see [WebMCP in Chrome](https://developer.chrome.com/docs/ai/webmcp) for how to enable it. ([microsoft/playwright#42671](https://redirect.github.com/microsoft/playwright/pull/42671)) - **🌗 Switch between light and dark color scheme** ([microsoft/playwright#42243](https://redirect.github.com/microsoft/playwright/issues/42243)) — an agent working on a dark theme had no way to see it mid-session. The new **`browser_emulate_media`** tool emulates media features on the fly: `colorScheme`, `reducedMotion`, `forcedColors`, `contrast` and the `media` type (screen / print). Omitted parameters are left unchanged, `null` clears an override. ([microsoft/playwright#42668](https://redirect.github.com/microsoft/playwright/pull/42668)) - **📁 Absolute paths in results** ([microsoft/playwright#42497](https://redirect.github.com/microsoft/playwright/issues/42497)) — links to snapshots, screenshots, console logs and downloads are relative to the workspace root, which a client without one cannot resolve. Pass `--file-paths=absolute` (config `filePaths: "absolute"`, env `PLAYWRIGHT_MCP_FILE_PATHS=absolute`) to get absolute paths instead. ([microsoft/playwright#42673](https://redirect.github.com/microsoft/playwright/pull/42673)) #### 🐛 Fixes - `fix(mcp): keep upload modal and reject bad headers` — a failed `browser_file_upload` (e.g. a missing file) reports the error and keeps the file chooser open so it can be retried, and `browser_route` (opt-in via `--caps=network`) returns an error for a header that is not in the `Name: Value` form instead of setting a header named `""`. ([microsoft/playwright#42713](https://redirect.github.com/microsoft/playwright/pull/42713)) - `fix(chromium): bypass service workers on the storage state page` — `browser_storage_state` (opt-in via `--caps=storage`) no longer runs the site's own scripts, or fails when they redirect, for origins with an active service worker ([microsoft/playwright#42656](https://redirect.github.com/microsoft/playwright/issues/42656)). ([microsoft/playwright#42664](https://redirect.github.com/microsoft/playwright/pull/42664), [microsoft/playwright#42741](https://redirect.github.com/microsoft/playwright/pull/42741)) #### 📦 Upgrading Configs that use `@playwright/mcp@latest` pick this release up on the next client restart. To pin it: ```bash npx @playwright/mcp@0.0.82 ``` ### [`v0.0.81`](https://redirect.github.com/microsoft/playwright-mcp/releases/tag/v0.0.81) [Compare Source](https://redirect.github.com/microsoft/playwright-mcp/compare/v0.0.80...v0.0.81) #### What's New ##### 🎉 New Tools - **`browser_webmcp_list` / `browser_webmcp_call`** — List and call the tools a page registers through the [WebMCP](https://webmachinelearning.github.io/webmcp/) API, letting the page do the work instead of driving its UI. When a page has WebMCP tools, the page status reports how many are available ([#​42613](https://redirect.github.com/microsoft/playwright/pull/42613)). WebMCP is experimental, see [WebMCP in Chrome](https://developer.chrome.com/docs/ai/webmcp) for how to enable it. ##### Other Changes - New `--profile-dir-name <name>` option (env `PLAYWRIGHT_MCP_PROFILE_DIR_NAME`) selects the Chrome profile to connect to in extension mode when the extension is installed in several profiles, for example `"Profile 1"` ([#​42527](https://redirect.github.com/microsoft/playwright/pull/42527)) - Headless browsers launched by the server are now closed after one hour without tool calls; the next tool call launches a new one. Use `--idle-timeout <ms>` (config `timeouts.idle`, env `PLAYWRIGHT_MCP_IDLE_TIMEOUT`) to change the timeout, `0` disables it. Headed and attached browsers are not closed unless a timeout is set explicitly ([#​42663](https://redirect.github.com/microsoft/playwright/pull/42663), [#​42676](https://redirect.github.com/microsoft/playwright/pull/42676)) - `--image-responses` accepts `only`: a response that carries an image consists of the image parts alone, without the text part ([#​42672](https://redirect.github.com/microsoft/playwright/pull/42672)) #### Bug Fixes - `browser_close` returns an error when the browser context is shared (`--shared-browser-context`) instead of breaking the calling client's session. This supersedes the v0.0.80 change that dropped the backend after `browser_close` ([#​42495](https://redirect.github.com/microsoft/playwright/pull/42495)) - With `--shared-browser-context`, `browser_start_recording` / `browser_stop_recording` (opt-in via `--caps=devtools`) keep each client's recording separate instead of delivering one client's recorded actions to another ([#​42622](https://redirect.github.com/microsoft/playwright/pull/42622), [#​42627](https://redirect.github.com/microsoft/playwright/pull/42627)) - The file access check follows symlinks, so a symlink inside the workspace can no longer be used to read or write files outside the allowed roots ([#​42628](https://redirect.github.com/microsoft/playwright/pull/42628)) - Explicitly named output files in a nested directory (e.g. `sub/shot.png`) no longer fail with `ENOENT`; `browser_file_upload` and `browser_drop` resolve relative paths against the workspace root ([#​42540](https://redirect.github.com/microsoft/playwright/pull/42540)) - In extension mode with `PLAYWRIGHT_MCP_EXTENSION_TOKEN` set, a connection that never completes (e.g. the token belongs to another Chrome profile) now fails after 30 seconds with a hint instead of hanging the tool call forever ([#​42525](https://redirect.github.com/microsoft/playwright/pull/42525)) - Disable the Chromium sandbox by default on Linux for the bundled Chromium build, which lacks the setuid sandbox helper ([#​42490](https://redirect.github.com/microsoft/playwright/pull/42490)) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/nikzlabs/shipit). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xMDMuMCIsInVwZGF0ZWRJblZlciI6IjQ0LjEzNC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
Summary
maybeNotifyWebMCPToolsChangedkept the previous tool definitions whenever the schema signature was unchanged. Each definition's handler is a closure over the tab and frame it was listed from, so after a reload an iframe tool failed with "Frame was detached", and with two tabs exposing the same tools the call ran in the previous tab.listChangednotification on the schema signature. Add tests for both cases.Fixes #42816