Uh oh!
There was an error while loading. Please reload this page.
feat(api): Page.hideHighlight, rename ref → target - #40219
Conversation
- Adds `Page.hideHighlight()` public API that clears all locator highlight
overlays added on the page. Implemented as a new internal Page channel
command routed to the existing server-side `Page.hideHighlight()`.
- MCP `browser_hide_highlight` now accepts an optional element: with a
target it removes that highlight; without one it calls `page.hideHighlight()`
to clear them all. CLI `highlight --hide` (no target) does the same.
- Renames the snapshot-derived element identifier across the MCP/CLI surface
from `ref` to `target` for consistency:
- `elementSchema`/`optionalElementSchema`: `ref` → `target`.
- `browser_drag` schema: `startRef`/`endRef` → `startTarget`/`endTarget`.
- `Tab.refLocator`/`refLocators` → `targetLocator`/`targetLocators`,
parameter `ref` → `target`.
- All MCP tool handlers updated.
- CLI `commands.ts` argument names back to `target`.
- Tests updated to send `arguments: { target: 'eN' }`.
The internal `aria-ref=` selector engine and the `Locator.ariaRef()` API
are unrelated and stay as-is.a03f682 to
f52a53aCompare| export const optionalElementSchema = z.object({ | ||
| ref: z.string().optional().describe('Element reference from the previous page snapshot to capture a partial snapshot instead of the whole page'), | ||
| selector: z.string().optional().describe('Element selector of the root element to capture a partial snapshot instead of the whole page'), | ||
| element: z.string().optional().describe('Human-readable element description used to obtain permission to interact with the element'), |
There was a problem hiding this comment.
what does this description mean? If the description is different depending on use case, make it a function that accepts the description as a param
There was a problem hiding this comment.
This has not changed, it is taken from elementDescription.
57888a5
into
microsoft:mainUh oh!
There was an error while loading. Please reload this page.
Test results for "tests 1"2 failed 4 flaky39172 passed, 847 skipped Merge workflow run. |
Test results for "MCP"1 failed 6043 passed, 976 skipped Merge workflow run. |
Ports the following upstream client-side PRs: - microsoft/playwright#39767 - feat: Add `location()` to `WebError` - microsoft/playwright#39950 - feat: page version of toMatchAriaSnapshot - microsoft/playwright#40083 - feat(locator): add `description` option to getByRole - microsoft/playwright#40092 - feat(expect): support pseudo-element in toHaveCSS - microsoft/playwright#40159 - feat(tracing): add tracing.startHar / tracing.stopHar - microsoft/playwright#40196 - chore: remove deprecated `handle` option from exposeBinding - microsoft/playwright#40215 - feat(api): Locator.highlight({ style }) - microsoft/playwright#40219 - feat(api): Page.hideHighlight, Locator.hideHighlight, highlight() returns AutoCloseable - microsoft/playwright#40283 - feat(locator): add drop API for files and clipboard-like data - microsoft/playwright#40315 - feat(browser): Browser.onContext / offContext - microsoft/playwright#40341 - feat(browsercontext): mirror Page lifecycle events on BrowserContext - microsoft/playwright#40377 - feat(route): expose WebSocket subprotocols on WebSocketRoute - microsoft/playwright#40606 - feat(api): unify WebError and ConsoleMessage location - microsoft/playwright#40651 - docs: alias drop-payload Object types Protocol shape change for FrameExpectResult.received (now `{ value, ariaSnapshot }` instead of a bare SerializedValue) — updated AssertionsBase to unwrap it. Generator updates: added new types to relevant import lists; share topLevelTypes between the assertion and non-assertion generate runs so PseudoElement gets emitted into options/.
Ports the following upstream client-side PRs: - microsoft/playwright#39767 - feat: Add `location()` to `WebError` - microsoft/playwright#39950 - feat: page version of toMatchAriaSnapshot - microsoft/playwright#40083 - feat(locator): add `description` option to getByRole - microsoft/playwright#40092 - feat(expect): support pseudo-element in toHaveCSS - microsoft/playwright#40159 - feat(tracing): add tracing.startHar / tracing.stopHar - microsoft/playwright#40196 - chore: remove deprecated `handle` option from exposeBinding - microsoft/playwright#40215 - feat(api): Locator.highlight({ style }) - microsoft/playwright#40219 - feat(api): Page.hideHighlight, Locator.hideHighlight, highlight() returns AutoCloseable - microsoft/playwright#40283 - feat(locator): add drop API for files and clipboard-like data - microsoft/playwright#40315 - feat(browser): Browser.onContext / offContext - microsoft/playwright#40341 - feat(browsercontext): mirror Page lifecycle events on BrowserContext - microsoft/playwright#40377 - feat(route): expose WebSocket subprotocols on WebSocketRoute - microsoft/playwright#40606 - feat(api): unify WebError and ConsoleMessage location - microsoft/playwright#40651 - docs: alias drop-payload Object types Protocol shape change for FrameExpectResult.received (now `{ value, ariaSnapshot }` instead of a bare SerializedValue) — updated AssertionsBase to unwrap it. Generator updates: added new types to relevant import lists; share topLevelTypes between the assertion and non-assertion generate runs so PseudoElement gets emitted into options/.
Summary
Page.hideHighlight()API that clears all locator highlights on the pagebrowser_hide_highlightand CLIhighlight --hide(no target) clear all highlights when called without a specific elementreftotarget(elementSchema,browser_drag'sstartTarget/endTarget,Tab.targetLocator/targetLocators, CLI args, tests). Thearia-ref=selector engine andLocator.ariaRef()are unrelated and stay as-is.