Skip to content

Add session-owned Chrome viewport emulation for responsive FSV #1215

@ChrisRoyse

Description

@ChrisRoyse

Parent: #717. Related: #1202, #1212.

Problem

During calyxwebsite #1261 layout FSV, Synapse could open background tabs in the existing Chrome window and capture target-specific screenshots, but there is no exposed tool to set a session-owned tab viewport / device emulation for phone-width visual verification. (Confirmed absent: no Emulation.setDeviceMetricsOverride path in crates/synapse-mcp/src.)

Related friction: after cdp_navigate_tab on a session-owned Chrome bridge target, target_act verb=screenshot refused the same target with ACTION_TARGET_INVALID / missing session-owned Chrome bridge owner row. Opening a fresh session-owned tab restored capture.

Needed capability

  • Session-targeted tool to set viewport bounds / device emulation (width/height/deviceScaleFactor, mobile flag) on an existing Chrome tab without launching a new browser — via CDP Emulation.setDeviceMetricsOverride.
  • Separate SoT readback of viewport width/height/deviceScaleFactor after setting it.
  • Target screenshot ownership survives same-session cdp_navigate_tab, or cdp_navigate_tab refreshes the owner row so target_act verb=screenshot stays valid.

FSV context

  • Existing Chrome HWND 2427400.
  • Screenshot worked on a fresh tab, producing chrome_debugger_page_capture_screenshot_bgra captures.
  • Desktop proof possible; phone-width proof was limited to built-CSS/source checks because viewport emulation is not exposed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions