Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
badlogic avatar

Browser Tools

  • 341 installs
  • 2.3k repo stars
  • Updated June 6, 2026
  • badlogic/pi-skills

browser-tools is an agent skill that provides Chrome DevTools Protocol automation scripts for developers who need coding agents to navigate pages, extract data, fill forms, and verify web UI behavior in a real browser.

About

browser-tools is a pi-skills package that equips coding agents with Chrome DevTools Protocol automation for real-browser testing. After `npm install` in the skill folder, agents launch Chrome on port 9222 and run bundled Node scripts for navigation, JavaScript evaluation, screenshots, interactive element picking, cookie inspection, and markdown content extraction via Readability and Turndown. The skill emphasizes DOM inspection over screenshots and batching interactions in single `browser-eval.js` calls. Developers reach for browser-tools when Playwright-style MCP is unavailable but a visible Chrome session is needed to test SPAs, debug auth cookies, or scrape JavaScript-rendered pages during development.

  • Headless browser automation
  • Page navigation and scraping
  • Form fill and UI interaction
  • Web verification for agents
  • Pi-skills tool integration

Browser Tools by the numbers

  • 341 all-time installs (skills.sh)
  • Ranked #2,164 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/badlogic/pi-skills --skill browser-tools

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs341
repo stars2.3k
Last updatedJune 6, 2026
Repositorybadlogic/pi-skills

How do agents automate Chrome for frontend testing?

Equip coding agents with browser automation tools to navigate pages, extract data, fill forms, and verify web UI behavior during development workflows.

Who is it for?

Developers wiring coding agents to test React, Vue, or other JavaScript frontends in a real Chrome session with DevTools Protocol scripts.

Skip if: Developers who only need headless HTTP scraping without JavaScript execution or a running Chrome instance.

When should I use this skill?

An agent must interact with a live web page, verify UI behavior, debug session cookies, or extract dynamic content that requires JavaScript rendering.

What you get

Chrome debug session on port 9222, DOM evaluation results, screenshots, picked CSS selectors, and extracted markdown page content.

  • Browser session logs
  • DOM evaluation output
  • Screenshots and markdown extracts

By the numbers

  • Connects to Chrome remote debugging on port 9222
  • Bundles 7 browser automation scripts in the skill directory
  • Part of the 8-skill badlogic/pi-skills collection

Files

SKILL.mdMarkdownGitHub ↗

Browser Tools

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

Setup

Run once before first use:

cd {baseDir}/browser-tools
npm install

Start Chrome

{baseDir}/browser-start.js              # Fresh profile
{baseDir}/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

{baseDir}/browser-nav.js https://example.com
{baseDir}/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

{baseDir}/browser-eval.js 'document.title'
{baseDir}/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

{baseDir}/browser-screenshot.js

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

Pick Elements

{baseDir}/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

{baseDir}/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.

Extract Page Content

{baseDir}/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).

When to Use

  • Testing frontend code in a real browser
  • Interacting with pages that require JavaScript
  • When user needs to visually see or interact with a page
  • Debugging authentication or session issues
  • Scraping dynamic content that requires JS execution

---

Efficiency Guide

DOM Inspection Over Screenshots

Don't take screenshots to see page state. Do parse the DOM directly:

// Get page structure
document.body.innerHTML.slice(0, 5000)

// Find interactive elements
Array.from(document.querySelectorAll('button, input, [role="button"]')).map(e => ({
  id: e.id,
  text: e.textContent.trim(),
  class: e.className
}))

Complex Scripts in Single Calls

Wrap everything in an IIFE to run multi-statement code:

(function() {
  // Multiple operations
  const data = document.querySelector('#target').textContent;
  const buttons = document.querySelectorAll('button');
  
  // Interactions
  buttons[0].click();
  
  // Return results
  return JSON.stringify({ data, buttonCount: buttons.length });
})()

Batch Interactions

Don't make separate calls for each click. Do batch them:

(function() {
  const actions = ["btn1", "btn2", "btn3"];
  actions.forEach(id => document.getElementById(id).click());
  return "Done";
})()

Typing/Input Sequences

(function() {
  const text = "HELLO";
  for (const char of text) {
    document.getElementById("key-" + char).click();
  }
  document.getElementById("submit").click();
  return "Submitted: " + text;
})()

Reading App/Game State

Extract structured state in one call:

(function() {
  const state = {
    score: document.querySelector('.score')?.textContent,
    status: document.querySelector('.status')?.className,
    items: Array.from(document.querySelectorAll('.item')).map(el => ({
      text: el.textContent,
      active: el.classList.contains('active')
    }))
  };
  return JSON.stringify(state, null, 2);
})()

Waiting for Updates

If DOM updates after actions, add a small delay with bash:

sleep 0.5 && {baseDir}/browser-eval.js '...'

Investigate Before Interacting

Always start by understanding the page structure:

(function() {
  return {
    title: document.title,
    forms: document.forms.length,
    buttons: document.querySelectorAll('button').length,
    inputs: document.querySelectorAll('input').length,
    mainContent: document.body.innerHTML.slice(0, 3000)
  };
})()

Then target specific elements based on what you find.

Related skills

How it compares

Pick browser-tools for lightweight CDP scripts tied to a visible Chrome instance; prefer dedicated browser MCP servers when you need full Playwright-level tooling inside the IDE.

FAQ

What does browser-tools require before first use?

browser-tools requires Chrome with remote debugging enabled and Node.js dependencies installed via `npm install` inside the browser-tools skill directory. Agents launch Chrome on port 9222 using the bundled `browser-start.js` script.

When should agents use browser-pick.js?

browser-tools directs agents to `browser-pick.js` when users need to select specific DOM elements interactively. The picker returns CSS selectors after Cmd/Ctrl+Click multi-select, which is preferable to guessing selectors on complex pages.

AI & Agent Buildingautomationagents

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.