Skip to content

[Feature]: _snapshotForAI should return focused and focusable #36041

Open
@george-cz

Description

@george-cz

🚀 Feature Request

Hello, MS employee here (Teams).

We are using the playwright-mcp, which relies heavily on snapshots, returned from _snapshotForAI.

For our use case it would be very useful if the snapshot contained information about currently focused element, i.e. the focused key.

The possibility to get the list of focusable elements would be appreciated too (focusable key), as this might prove useful for our other scenarios.

Example

Testing focus movement/accessibility.

Motivation

There should be a way for the MCP client that uses playwright-mcp to tell which element is focused. This is useful for testing the correct focus behavior and accessibility.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions