DebugBrowser Screenshots
DocsToolsBrowser Screenshots

Browser Screenshots

Quick browser screenshots for debugging web applications

Quick Start

Take a screenshot in two commands - no code required:

Terminalbash
$co browser go_to localhost:3000
$co browser take_screenshot
Instant capture
Persistent browser
Custom viewports
PNG format

Command Format

co browser <function> [args...]
<function>Required. Any function from co browser help (e.g., go_to, take_screenshot, click), or do for the AI agent
[args...]Optional. Plain string arguments for that function

The first command starts a background daemon owning one browser; every later command drives that same browser until you run co browser close.

Examples

Basic Screenshots

Terminalbash
$# Screenshot local development
$co browser go_to localhost:3000
$co browser take_screenshot
$
$# With specific port
$co browser go_to localhost:8080
$co browser take_screenshot
$
$# External site
$co browser go_to example.com
$co browser take_screenshot

Save to Specific Path

Terminalbash
$# Save to temp directory
$co browser take_screenshot /tmp/debug.png
$
$# Save with custom name
$co browser take_screenshot homepage.png
$
$# Save to subdirectory
$co browser take_screenshot screenshots/test.png

Custom Viewport Sizes

Terminalbash
$# Phone-sized viewport
$co browser set_viewport 390 844
$
$# Tablet-sized viewport
$co browser set_viewport 768 1024
$
$# Desktop-sized viewport
$co browser set_viewport 1920 1080

There are no named device presets — pass explicit width/height pixels.

Common Viewport Sizes

There are no named presets — pass set_viewport width height with the pixel dimensions you want:

CommandRoughly matchesIcon
set_viewport 390 844iPhone 14/15
set_viewport 360 800Common Android
set_viewport 768 1024iPad
set_viewport 1920 1080Full HD Desktop

Complete Examples

Debug mobile checkout flowbash
$co browser set_viewport 390 844
$co browser go_to localhost:3000/checkout
$co browser take_screenshot /tmp/checkout-mobile.png
Document bug on specific pagebash
$co browser set_viewport 1920 1080
$co browser go_to localhost:3000/xray
$co browser take_screenshot bug-report.png
Test responsive designbash
$co browser go_to localhost:3000
$co browser set_viewport 390 844 && co browser take_screenshot mobile.png
$co browser set_viewport 768 1024 && co browser take_screenshot tablet.png
$co browser set_viewport 1920 1080 && co browser take_screenshot desktop.png

Use Cases

Debug Local Development

Quick visual checks during development

Terminalbash
$# Quick check of homepage
$co browser go_to localhost:3000
$co browser take_screenshot
$
$# Debug specific route
$co browser go_to localhost:3000/api/status
$co browser take_screenshot

Document Bugs

Capture visual proof of issues

Terminalbash
$# Capture error state
$co browser go_to localhost:3000/error
$co browser take_screenshot bug.png
$
$# Mobile-specific issue
$co browser set_viewport 390 844
$co browser go_to localhost:3000/mobile-bug
$co browser take_screenshot mobile-issue.png

Test Responsive Design

Verify layouts across viewport sizes

co browser go_to localhost:3000
co browser set_viewport 390 844 && co browser take_screenshot view-mobile.png
co browser set_viewport 768 1024 && co browser take_screenshot view-tablet.png
co browser set_viewport 1920 1080 && co browser take_screenshot view-desktop.png

CI/CD Integration

Automated visual testing

Terminalbash
$# In GitHub Actions
$co browser go_to $DEPLOY_URL
$co browser take_screenshot artifacts/deployed.png
$co browser close

URL Handling

The command intelligently handles URLs:

localhosthttp://localhost
localhost:3000http://localhost:3000
example.comhttps://example.com
http://example.comhttp://example.com(unchanged)

Installation

Standard Installation

Browser automation is built on Patchright (a stealth-patched Playwright fork):

Terminalbash
$pip install patchright
$patchright install chrome

If no browser is found, Chromium is auto-installed per-user with no admin rights required (v1.2.1+).

Framework Examples

Next.js

Terminalbash
$co browser go_to localhost:3000
$co browser take_screenshot
$co browser go_to localhost:3000/_error
$co browser take_screenshot error.png

FastAPI

Terminalbash
$co browser go_to localhost:8000
$co browser take_screenshot
$co browser go_to localhost:8000/docs
$co browser take_screenshot api-docs.png

Django

Terminalbash
$co browser go_to localhost:8000
$co browser take_screenshot
$co browser go_to localhost:8000/admin
$co browser take_screenshot admin.png

React Dev Server

Terminalbash
$co browser go_to localhost:3000
$co browser take_screenshot
$co browser set_viewport 390 844 && co browser take_screenshot mobile.png

Common Error Messages

❌ unknown command: frobnicate
Function name not found — run co browser help to list valid functions
❌ Browser tools not installed
Run: pip install patchright && patchright install chrome
❌ Cannot reach http://localhost:3000
Is your server running?
❌ Cannot save to /root/test.png (permission denied)
Check file permissions

Tips

Quick Debug

Just co browser go_to localhost:3000 && co browser take_screenshot for instant feedback

Organize Screenshots

Use descriptive absolute paths like /tmp/bugs/issue-123.png — the daemon resolves relative paths against its own working directory

Test Viewports

Use set_viewport width height before screenshotting — there are no named device presets

Discover Functions

Run co browser help to list every callable function and its arguments

Limitations

  • One browser window per daemon — close it before starting a differently-configured one
  • Relative paths resolve against the daemon's working directory, not your shell's current directory
  • Visible browser window by default (pass --headless to run without one)
  • Screenshots save as PNG

For sophisticated flows, hand the browser to the AI agent with co browser do "...", or build an agent with the BrowserAutomation tool directly.

Summary

co browser gives you a persistent, scriptable browser from the shell. Call functions directly for deterministic steps, or hand the wheel to the AI agent with do "...". Perfect for debugging during development.

Star us on GitHub

If ConnectOnion saves you time, a ⭐ goes a long way — and earns you a coffee chat with our founder.