feat(api): Page.hideHighlight, rename ref → target#40219
Merged
pavelfeldman merged 1 commit intomicrosoft:mainfrom Apr 15, 2026
Merged
feat(api): Page.hideHighlight, rename ref → target#40219pavelfeldman merged 1 commit intomicrosoft:mainfrom
pavelfeldman merged 1 commit intomicrosoft:mainfrom
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
f52a53a
Compare
yury-s
approved these changes
Apr 15, 2026
| 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'), |
Member
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
Member
Author
There was a problem hiding this comment.
This has not changed, it is taken from elementDescription.
Contributor
Test results for "tests 1"2 failed 4 flaky39172 passed, 847 skipped Merge workflow run. |
Contributor
Test results for "MCP"1 failed 6043 passed, 976 skipped Merge workflow run. |
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
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.