Requirements
- Target platform
- OpenClaw
- Install method
- Manual import
- Extraction
- Extract archive
- Prerequisites
- OpenClaw
- Primary doc
- SKILL.md
Zero-token browser automation via Playwright scripts with CDP lock management and human-like interaction. Use when: (1) automating any browser-based workflow...
Zero-token browser automation via Playwright scripts with CDP lock management and human-like interaction. Use when: (1) automating any browser-based workflow...
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
Explore β Record β Replay β Fix. Convert expensive browser-tool interactions into zero-token Playwright scripts that reuse OpenClaw's Chrome session (cookies/login intact).
Install Playwright (once per machine): npm install -g playwright # or in workspace: npm init -y && npm install playwright No browser download needed β scripts connect to OpenClaw's existing Chrome via CDP.
Chrome user-data: ~/.openclaw/browser/openclaw/user-data β shared cookies/login (mutually exclusive CDP) ββββββββββββββββ ββββββββββββββββββββ β browser tool β OR β Playwright script β β (explore) β β (zero token) β ββββββββββββββββ ββββββββββββββββββββ β managed by browser-lock.sh Only one CDP client can connect at a time. browser-lock.sh handles the mutex.
Copy scripts/browser-lock.sh to your workspace scripts/ directory Copy scripts/utils/human-like.js to your workspace scripts/browser/utils/ chmod +x scripts/browser-lock.sh Create scripts/browser/ for your automation scripts
Use the OpenClaw browser tool (snapshot/act) to figure out a workflow. Note selectors, page flow, key waits.
Convert steps into a script. Save to scripts/browser/<verb>-<target>.js. Use the template pattern: const { chromium } = require('playwright'); const { humanDelay, humanClick, humanType, humanThink, humanBrowse } = require('./utils/human-like'); function discoverCdpUrl() { try { const { execSync } = require('child_process'); const ps = execSync("ps aux | grep 'remote-debugging-port' | grep -v grep", { encoding: 'utf8' }); const match = ps.match(/remote-debugging-port=(\d+)/); return `http://127.0.0.1:${match ? match[1] : '18800'}`; } catch { return 'http://127.0.0.1:18800'; } } async function main() { const browser = await chromium.connectOverCDP(discoverCdpUrl()); const context = browser.contexts()[0]; // reuse existing context (cookies/login) const page = await context.newPage(); try { // automation here β use human-like functions await page.goto('https://example.com', { waitUntil: 'networkidle', timeout: 30000 }); await humanBrowse(page); // simulate looking at the page await humanClick(page, 'button.submit'); await humanType(page, 'input[name="title"]', 'Hello World'); } finally { await page.close(); // NEVER browser.close() β kills entire Chrome } } main().then(() => process.exit(0)).catch(e => { console.error('β', e.message); process.exit(1); });
./scripts/browser-lock.sh run scripts/browser/my-task.js [args] ./scripts/browser-lock.sh run --timeout 120 scripts/browser/my-task.js
Read script error output Re-explore the failing step with browser tool (snapshot) to check current UI Update script with corrected selectors/logic Retry Never guess fixes blindly. Always re-explore the actual page state.
Manages CDP mutex between OpenClaw browser and Playwright scripts. ./scripts/browser-lock.sh run <script.js> [args] # acquire β run β release (300s default) ./scripts/browser-lock.sh run --timeout 120 <script> # custom timeout ./scripts/browser-lock.sh acquire # manual: stop OpenClaw browser, start Chrome ./scripts/browser-lock.sh release # manual: kill Chrome, release lock ./scripts/browser-lock.sh status # show state Lock file: /tmp/openclaw-browser.lock. Stale locks auto-recover.
All scripts must use human-like.js. See references/anti-detection.md for the full rule set. Summary of critical rules: β Bannedβ RequiredwaitForTimeout(3000) fixed delayshumanDelay(2000, 4000) random rangeinput.fill(text) instant fillhumanType(page, sel, text) char-by-char with typoselement.click() teleport clickhumanClick(page, sel) bezier mouse path + hoverDirect page operation after loadhumanBrowse(page) simulate reading firstnativeSetter.call() DOM injectionhumanType() or humanFillContentEditable()Fixed cron schedulejitterWait(1, 10) random offset Exception: setInputFiles() for file uploads is allowed (no human simulation possible), but add random delays before/after.
FunctionPurposehumanDelay(min, max)Random wait (ms)humanThink(min, max)Longer pause before form fillshumanClick(page, sel)Bezier mouse move β hover β click with press/release jitterhumanType(page, sel, text, opts)Char-by-char typing, normal distribution speed, 3% typo ratehumanFillContentEditable(page, sel, text)For contenteditable divs (line-by-line Enter + humanType)humanBrowse(page, opts)Simulate page reading (scroll + mouse wander, 2-5s)humanScroll(page, opts)Random scroll with occasional reversejitterWait(minMin, maxMin)Random delay in minutes for cron tasks
<verb>-<target>.js β e.g. publish-deviantart.js, read-inbox.js, reply-comment.js
Production-tested scripts in scripts/examples/. Copy to your workspace scripts/browser/ and adapt. ScriptPlatformFunctionpublish-deviantart.jsDeviantArtUpload image, fill title/desc/tags, submitpublish-xiaohongshu.jsε°ηΊ’δΉ¦Publish image note with topic tag association via recommend listpublish-pinterest.jsPinterestCreate pin with title/desc, select boardpublish-behance.jsBehanceUpload project with title/desc/tags/categoriesread-proton-latest.jsProton MailRead inbox, output JSON list of emailsread-xhs-comments.jsε°ηΊ’δΉ¦Read notification comments, output JSON with reply button indexreply-xhs-comment.jsε°ηΊ’δΉ¦Reply to a specific comment by index Usage pattern: # Copy examples to workspace cp scripts/examples/*.js scripts/browser/ cp scripts/utils/human-like.js scripts/browser/utils/ # Run ./scripts/browser-lock.sh run scripts/browser/publish-deviantart.js image.png "Title" "Description" "tag1,tag2" ./scripts/browser-lock.sh run scripts/browser/read-xhs-comments.js --limit 10 ./scripts/browser-lock.sh run scripts/browser/reply-xhs-comment.js 0 "εε€ζε" All example scripts already use human-like.js for anti-detection.
cd /path/to/workspace && ./scripts/browser-lock.sh run scripts/browser/task.js Add jitterWait() at script start to randomize execution time.
ProblemFixLock held by PID xxx./scripts/browser-lock.sh releaseCDP connection timeoutEnsure acquire was called / Chrome is runningLogin expiredUse browser tool to re-login, then run scriptSelector not foundRe-explore with browser tool, update scriptScript timeoutIncrease with --timeout flag
VarDefaultDescriptionCDP_PORTauto-discoverOverride CDP portCHROME_BINauto-detectChrome binary pathHEADLESSautotrue/false to force headless
Code helpers, APIs, CLIs, browser automation, testing, and developer operations.
Largest current source with strong distribution and engagement signals.