8000 feat(browser): screenshot_page is full-page only — add clip/selector/viewport option · Issue #3 · Mnehmos/mnehmos.ooda.mcp · GitHub
[go: up one dir, main page]

Skip to content

feat(browser): screenshot_page is full-page only — add clip/selector/viewport option #3

Open

Description

@Mnehmos

Summary

screenshot_page only captures the full page. On a long single-scroll app (~6000px tall in my case) every capture is a huge image even when only a small region (the chessboard) mattered — costly in tokens and latency, and harder to read.

Detail

  • There's no clip, selector, or fullPage:false option on screenshot_page.
  • The separate screenshot tool does have a region param, but that captures the OS screen, not page coordinate space — so it's the wrong tool for a headless browser (nothing is on screen).

So for headless browser work there's no way to capture just the viewport or a single element.

Suggested fix

Add one or more of:

  • fullPage: false -> capture only the current viewport.
  • clip: { x, y, width, height } -> capture a page-space rectangle (Playwright page.screenshot({ clip })).
  • selector: string -> capture an element's bounding box (Playwright locator.screenshot()).

Any of these would cut image size dramatically when the caller knows what they care about.

Environment

  • Engine: Playwright, headless.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      0