Skip to content
This repository was archived by the owner on Nov 23, 2025. It is now read-only.

badlogic/browser-tools

Repository files navigation

⚠️ DEPRECATED: This repository has been moved to badlogic/agent-tools. Please use that repository instead.


Browser Tools

Chrome DevTools Protocol tools for agent-assisted web automation. These tools connect to Chrome running on :9222 with remote debugging enabled.

How to Invoke These Tools

CRITICAL FOR AGENTS: These are executable scripts in your PATH. When invoking via the Bash tool:

✓ CORRECT:

browser-start.js
browser-nav.js https://example.com
browser-pick.js "Click the button"

✗ INCORRECT:

node browser-start.js        # Don't use 'node' prefix
./browser-start.js           # Don't use './' prefix

Start Chrome

browser-start.js              # Fresh profile
browser-start.js --profile    # Copy user's profile (cookies, logins)

Launch Chrome with remote debugging on :9222. Use --profile to preserve user's authentication state.

Navigate

browser-nav.js https://example.com
browser-nav.js https://example.com --new

Navigate to URLs. Use --new flag to open in a new tab instead of reusing current tab.

Evaluate JavaScript

browser-eval.js 'document.title'
browser-eval.js 'document.querySelectorAll("a").length'

Execute JavaScript in the active tab. Code runs in async context. Use this to extract data, inspect page state, or perform DOM operations programmatically.

Screenshot

browser-screenshot.js

Capture current viewport and return temporary file path. Use this to visually inspect page state or verify UI changes.

Pick Elements

browser-pick.js "Click the submit button"

IMPORTANT: Use this tool when the user wants to select specific DOM elements on the page. This launches an interactive picker that lets the user click elements to select them. The user can select multiple elements (Cmd/Ctrl+Click) and press Enter when done. The tool returns CSS selectors for the selected elements.

Common use cases:

  • User says "I want to click that button" → Use this tool to let them select it
  • User says "extract data from these items" → Use this tool to let them select the elements
  • When you need specific selectors but the page structure is complex or ambiguous

Cookies

browser-cookies.js

Display all cookies for the current tab including domain, path, httpOnly, and secure flags. Use this to debug authentication issues or inspect session state.

Search Google

browser-search.js "rust programming"
browser-search.js "climate change" -n 10
browser-search.js "machine learning" -n 3 --content

Search Google and return results. Options:

  • -n <num> - Number of results (default: 5, supports pagination for higher numbers)
  • --content - Fetch and extract readable content as markdown from each result

Extract Page Content

browser-content.js https://example.com

Navigate to a URL and extract readable content as markdown. Uses Mozilla Readability for article extraction and Turndown for HTML-to-markdown conversion. Works on pages with JavaScript content (waits for page to load).

Search + Content Strategies

Use browser-search.js --content when you want content from all search results in one go. This is faster but fetches content from possibly irrelevant results.

browser-search.js "climate change effects" -n 3 --content

Use browser-search.js + browser-content.js when you want to selectively fetch content from only relevant results. First search, review the titles/snippets, then fetch content only for promising URLs.

browser-search.js "climate change effects" -n 10
# Review results, then fetch specific ones:
browser-content.js https://relevant-article.com
browser-content.js https://another-good-source.com

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published