An OpenClaw skill that bridges the built-in browser tool with Playwright scripts β sharing the same Chrome instance, cookies, and login state.
OpenClaw's browser tool and Playwright both use Chrome DevTools Protocol (CDP), but they can't connect simultaneously. This skill provides a lock-based manager that lets them take turns.
Chrome (shared cookies/login)
β mutually exclusive
ββββββββββββββββ ββββββββββββββββββββ
β OpenClaw β OR β Playwright script β
β browser tool β β (zero token cost) β
ββββββββββββββββ ββββββββββββββββββββ
- Explore β Use OpenClaw's browser tool to figure out a new workflow
- Record β Convert the steps into a Playwright script
- Replay β Run via
browser-lock.shβ zero token cost, deterministic, schedulable
# Install Playwright (no browser download needed β connects to existing Chrome)
npm install playwright
# Run a script (auto-manages Chrome lifecycle + lock)
./scripts/browser-lock.sh run my-script.js
# With timeout (default: 300s)
./scripts/browser-lock.sh run --timeout 60 my-script.js- π Lock-based mutex β prevents CDP conflicts between OpenClaw and Playwright
- πͺ Shared login state β same Chrome user-data-dir, no re-authentication
- β± Timeout watchdog β kills hung scripts, auto-releases lock
- π₯ Headless support β auto-detects headless servers (Linux without display)
- π CDP auto-discovery β finds the debugging port from process args, env, or probing
| File | Purpose |
|---|---|
SKILL.md |
Full documentation for OpenClaw agents |
scripts/browser-lock.sh |
Lock manager (acquire/release/run/status) |
scripts/playwright-template.js |
Script starter template with CDP discovery |
MIT