chore: pass markTargets explicitly into action methods#40705
chore: pass markTargets explicitly into action methods#40705dgozman wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Server-side action implementations read progress.metadata.id directly to highlight resolved DOM elements in trace snapshots. Make the token an explicit option (`markTargets`) on the action methods, and have the frame / element-handle dispatchers pass it from the call metadata. Renames the parameter from `callId` to `markTargets` in injectedScript.markTargetElements and along the call chain.
Test results for "MCP"5 failed 7013 passed, 1068 skipped Merge workflow run. |
This comment has been minimized.
This comment has been minimized.
Test results for "tests 1"4 flaky41651 passed, 851 skipped Merge workflow run. |
|
|
||
| async getAttribute(params: channels.ElementHandleGetAttributeParams, progress: Progress): Promise<channels.ElementHandleGetAttributeResult> { | ||
| const value = await this._elementHandle.getAttribute(progress, params.name); | ||
| const value = await this._elementHandle.getAttribute(progress, params.name, { markTargets: progress.metadata.id }); |
There was a problem hiding this comment.
This does not make much sense to me! Why are you passing this?
Summary
progress.metadata.idto mark DOM elements for trace highlighting; the token is now an explicitmarkTargets?: stringoption threaded through action methods and helpers.markTargets: progress.metadata.idinto the call.markTargetElementsparameter renamed fromcallIdtomarkTargetsfor consistency.MarkTargetsOptionsbase type inserver/types.ts;StrictOptionsextends it soCommonActionOptions/PointerActionWaitOptionsinherit the field automatically.