
Browser Tools
FreeAutomate web interactions using Chrome DevTools Protocol.
Free · Opens the source repo
What Browser Tools does
Browser Tools provides a suite of utilities for automating web interactions through the Chrome DevTools Protocol. This skill allows developers and designers to interact with web pages programmatically, making it ideal for testing front-end code, scraping dynamic content, and debugging issues related to user sessions. By connecting to a Chrome instance with remote debugging enabled, users can perform a variety of tasks from navigating to URLs to executing JavaScript directly in the browser context.
The skill includes several key functionalities, such as navigating to specific URLs, evaluating JavaScript code in the active tab, capturing screenshots of the current viewport, and picking elements interactively from the DOM. This is particularly useful in scenarios where user interaction is required or when the page's structure is complex, allowing for precise element selection and data extraction. Additionally, the ability to display cookies for the current tab aids in troubleshooting authentication problems.
Users can also extract readable content from web pages, which is beneficial for scraping articles or other structured data. The tools are designed to work seamlessly with JavaScript-heavy websites, ensuring that the content is fully loaded before any operations are performed. This skill is especially valuable for front-end developers, QA engineers, and anyone involved in web automation or testing.
To get started, users need to install the necessary dependencies and launch Chrome with the appropriate flags. Once set up, the tools can be executed via simple command-line instructions, providing a straightforward interface for a range of web automation tasks.
When to use it
Use this skill when you need to automate interactions with web pages or test front-end applications in a real browser environment.
When not to use it
This skill may not be suitable for static websites or scenarios where no JavaScript execution is required.
What you can build with it
Automated Frontend Testing
Use Browser Tools to automate the testing of frontend applications by interacting with the UI elements directly.
Scraping Dynamic Content
Leverage the content extraction capabilities to scrape articles or data from JavaScript-rendered web pages.
Debugging User Sessions
Inspect cookies and session states to troubleshoot authentication issues effectively.
How to install Browser Tools
View source1. Install with the skills CLI
npx skills add badlogic/pi-skills/browser-tools --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by badlogicBrowser 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.
Frequently asked questions about Browser Tools
Similar skills
Playwright Component Testing
Test React and Vue components in isolation with Playwright.
Fluent UI Blazor
Integrate Fluent UI components in Blazor applications effortlessly.
Build MCP App
Create interactive UI widgets for MCP servers.
Web Design Reviewer
Identify and fix design issues in websites efficiently.
Markstream Install
Seamlessly integrate Markstream for Markdown rendering.
GSAP & Framer Scroll Animation
Create advanced scroll animations effortlessly.
