@m64/browser-tools

extensionmaintained

Minimal CDP tools for collaborative site exploration

by · v1.0.4 · published 3mo ago

$ pi install npm:@m64/browser-tools
downloads/mo
0
stars
0
last push
3mo ago
open issues
2

Signals

license: MITtestspi manifest: missinginstall size: —deps: 0peer deps: 0

Download trend

193 downloads · last 12 weeks (weekly)

README

browser-tools

Browser automation helpers for Pi using the Chrome DevTools Protocol.

This skill provides small scripts for starting a browser, navigating pages, evaluating JavaScript, taking screenshots, inspecting cookies, extracting content, and interactively picking elements.

Originally created by Mario Zechner. Linux support, npm packaging, and publication by m64.

Files

  • SKILL.md — skill instructions for the agent
  • browser-start.js — start Chrome/Chromium with remote debugging on :9222
  • browser-nav.js — navigate the active tab or open a new tab
  • browser-eval.js — run JavaScript in the active tab
  • browser-screenshot.js — capture a screenshot of the current page
  • browser-pick.js — interactive DOM element picker
  • browser-cookies.js — inspect cookies for the current tab
  • browser-content.js — extract readable page content as markdown

Install

Install as a Pi skill package

From npm:

pi install npm:@m64/browser-tools

From a local checkout:

pi install /absolute/path/to/browser-tools
# or
pi install ./browser-tools

This package now declares itself as a Pi package in package.json via the pi manifest and the pi-package keyword, so Pi can discover and load the browser-tools skill automatically.

Install the standalone CLI tools

If you only want the command-line tools outside Pi:

npm install -g @m64/browser-tools

From source:

cd /path/to/browser-tools
npm install

Usage

Start a browser:

browser-start
# or from source:
./browser-start.js

Navigate:

browser-nav https://example.com
# or from source:
./browser-nav.js https://example.com

Evaluate JavaScript:

browser-eval '({title: document.title, url: location.href})'
# or from source:
./browser-eval.js '({title: document.title, url: location.href})'

Linux support

browser-start.js supports Linux and macOS.

Behavior on Linux:

  • auto-detects google-chrome, google-chrome-stable, chromium, and Snap Chromium
  • uses headless mode automatically when no desktop display is available
  • supports overriding the browser path with CHROME_BIN

For Snap Chromium, the browser profile directory must live in the Snap-managed area, so the script uses:

~/snap/chromium/common/browser-tools

For non-Snap browsers, it uses:

~/.cache/browser-tools

Notes

  • Remote debugging port: 9222
  • --profile support in browser-start.js is currently macOS-only
  • The npm package exposes CLI binaries like browser-start, browser-nav, and browser-eval