Skip to content

browse: add viewport auto / viewport reset to unpin fixed viewport #1059

@markddyer

Description

@markddyer

Problem

browse viewport W×H pins the viewport via Playwright's setViewportSize, overriding the launch-time viewport: null that normally lets the viewport follow the real Chrome window size. Once pinned, there is no way to restore auto-follow behaviour without browse restart, which kills the Chrome session (and drops a /connect-chrome headed attachment back to launched mode).

Several skills call $B viewport as a side-effect (e.g. responsive testing, benchmarks with specific breakpoints), leaving the browser in a locked state even after the skill finishes. From the user's perspective the Chrome window is visibly larger than the viewport Claude is rendering into.

Repro

$B viewport 1280x520
$B js "window.innerWidth + 'x' + window.innerHeight"   # 1280x520
# resize Chrome window manually → viewport stays 1280x520

Proposal

A browse viewport auto (or viewport reset / viewport unpin) command that clears the pinned size and restores window-following behaviour, without tearing down the Chrome session.

In Playwright terms this means calling something like page.setViewportSize(null) where supported, or recreating the page/context with viewport: null. If neither is possible without a restart, even documenting the constraint + exposing a lightweight "soft restart that preserves the current tab/URL" would help.

Environment

  • Platform: Windows 11
  • Mode: both headed (via /connect-chrome) and launched reproduce

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions