Skip to content

voidborne-d/browser-playwright-bridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

browser-playwright-bridge

An OpenClaw skill that bridges the built-in browser tool with Playwright scripts β€” sharing the same Chrome instance, cookies, and login state.

Problem

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.

How It Works

Chrome (shared cookies/login)
       ↕ mutually exclusive
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ OpenClaw     β”‚ OR β”‚ Playwright script β”‚
β”‚ browser tool β”‚    β”‚ (zero token cost) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  1. Explore β€” Use OpenClaw's browser tool to figure out a new workflow
  2. Record β€” Convert the steps into a Playwright script
  3. Replay β€” Run via browser-lock.sh β€” zero token cost, deterministic, schedulable

Quick Start

# 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

Features

  • πŸ”’ 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

Files

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

License

MIT

About

OpenClaw skill: lock-based bridge between browser tool and Playwright scripts, sharing Chrome CDP and login state

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors