Skip to content

bug: Browser tool does not support custom viewport size for screenshots #138

Description

@JKGeovision

Hello,

I discovered a limitation where the browser tool does not allow setting a custom viewport size. The browser is launched with a fixed container viewport of 780x493 pixels, and there is no configuration option to change it.

This makes it impossible to take high-resolution screenshots (e.g. 1920x1080) using the integrated browser tool. The only option is to bypass the browser tool entirely and use chromium --headless --screenshot --window-size=1920,1080 directly from the command line, which defeats the purpose of having the browser tool for interactive browsing.

Steps to reproduce:

  1. Use the browser_navigate tool to open a website
  2. Use the browser_screenshot tool to capture a screenshot
  3. The resulting screenshot is only 780x493 pixels

What I tried:

  • browser_evaluate('window.resizeTo(1920, 1080)') — does not work in headless mode
  • Checked for a cptr config file (e.g. ~/.cptr/config.yaml) — none exists
  • No viewport_size parameter is exposed on any browser tool function

Thank you for your work, and I wish you all a great day,
Joshua Krimmer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions