| name | browser-tools |
|---|---|
| description | Interact with a web browser. Can start a browser, connect to it, evaluate JavaScript, make screenshots, read console logs and let the user select DOM elements. Use when interacting with unknown websites (e.g. scraping or Userscripts) or debugging browser-stuff. |
| compatibility | Requires Chrome and uv |
This skill provides various scripts to interact with a web browser. There is no need to use "sleep" since all scripts will wait automatically. You MUST change the working directory to this skill's base dir before running any script.
Always start Chrome with remote debugging first:
uv run scripts/start.pyuv run scripts/navigate.py https://example.com
# or open a new tab
uv run scripts/navigate.py https://example.com --newNOTE: Prefer get-html or pick whenever possible to save on token usage.
IMPORTANT: Top-level return statements cause a SyntaxError: Illegal return statement. Always wrap multi-statement scripts in an IIFE: (function() { ...; return result; })()
uv run scripts/evaluate.py "document.querySelectorAll('a').length"
# For multi-line scripts, use STDIN with heredoc — wrap in IIFE for return statements
uv run scripts/evaluate.py - <<'EOF'
(function() {
const elements = document.querySelectorAll('.item');
elements.forEach(el => el.classList.add('processed'));
return elements.length;
})()
EOF
# Or from a file
uv run scripts/evaluate.py path/to/script.jsUse an interactive element picker to instruct the user to pick DOM elements that should be debugged or shown:
uv run scripts/pick.py "Click the submit button"
uv run scripts/pick.py "Select all product cards"Returns element information including tag, id, class, text content, HTML, and parent hierarchy.
uv run scripts/mouse.py click "button#submit"
uv run scripts/mouse.py dblclick ".item"
uv run scripts/mouse.py hover "nav .menu-item"
uv run scripts/mouse.py right-click ".context-menu-trigger"
uv run scripts/mouse.py drag ".draggable" --to ".drop-zone"uv run scripts/fill.py "input#username" "john_doe"
uv run scripts/fill.py "textarea#comment" "Hello, world!" --clear
uv run scripts/fill.py "input[name='email']" "user@example.com"uv run scripts/check.py "input#accept-terms"
uv run scripts/check.py "input[name='newsletter']" --uncheck
uv run scripts/check.py "input[type='radio'][value='option1']"uv run scripts/press-key.py "Enter"
uv run scripts/press-key.py "Escape"
uv run scripts/press-key.py "a" --selector "input#search"uv run scripts/upload.py "input[type='file']" /path/to/file.pdf
uv run scripts/upload.py "#file-upload" /path/to/image1.jpg /path/to/image2.pnguv run scripts/download.py "a[href='/report.pdf']"
uv run scripts/download.py "button#download" --output ~/Documents/report.pdfuv run scripts/select-dropdown.py "select#country" "US"
uv run scripts/select-dropdown.py "select[name='color']" "Red" --by-label
uv run scripts/select-dropdown.py "#quantity" "2" --by-indexuv run scripts/cookies.pyuv run scripts/clear-cookies.pyuv run scripts/storage.pyuv run scripts/clear-storage.pyuv run scripts/console.py
uv run scripts/console.py --errors-onlyALWAYS start this script in a background agent. During this time, you can manually interact with the page to trigger network requests. The script then logs all requests made.
uv run scripts/network.py
uv run scripts/network.py --type fetch --show-body
uv run scripts/network.py --filter "api\\.example\\.com" --show-headersOutputs HTML with optional filtering and additional context.
uv run scripts/get-html.py
uv run scripts/get-html.py --filter "<button.*submit.*>"
uv run scripts/get-html.py --filter "data-id=\"\d+\"" --lines 10List all open tabs, switch to a specific tab, or close a tab:
uv run scripts/tabs.py
uv run scripts/tabs.py --switch 0
uv run scripts/tabs.py --close 1For detailed API reference, see REFERENCE.md.