# Send Browser Automation Ultra to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
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.
```
### Upgrade existing

```text
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.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "browser-automation-ultra",
    "name": "Browser Automation Ultra",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/swaylq/browser-automation-ultra",
    "canonicalUrl": "https://clawhub.ai/swaylq/browser-automation-ultra",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/browser-automation-ultra",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=browser-automation-ultra",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "references/anti-detection.md",
      "scripts/browser-lock.sh",
      "scripts/examples/publish-behance.js",
      "scripts/examples/publish-deviantart.js",
      "scripts/examples/publish-pinterest.js"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/browser-automation-ultra"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/browser-automation-ultra",
    "downloadUrl": "https://openagent3.xyz/downloads/browser-automation-ultra",
    "agentUrl": "https://openagent3.xyz/skills/browser-automation-ultra/agent",
    "manifestUrl": "https://openagent3.xyz/skills/browser-automation-ultra/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/browser-automation-ultra/agent.md"
  }
}
```
## Documentation

### Browser Automation Ultra

Explore → Record → Replay → Fix. Convert expensive browser-tool interactions into zero-token Playwright scripts that reuse OpenClaw's Chrome session (cookies/login intact).

### Prerequisites

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.

### Architecture

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.

### Setup

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

### 1. Explore (browser tool, costs tokens)

Use the OpenClaw browser tool (snapshot/act) to figure out a workflow. Note selectors, page flow, key waits.

### 2. Record (write a Playwright script)

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); });

### 3. Replay (zero tokens)

./scripts/browser-lock.sh run scripts/browser/my-task.js [args]
./scripts/browser-lock.sh run --timeout 120 scripts/browser/my-task.js

### 4. Fix (on error)

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.

### browser-lock.sh

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.

### Anti-Detection Rules (MANDATORY)

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.

### human-like.js API

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

### Script Naming Convention

<verb>-<target>.js — e.g. publish-deviantart.js, read-inbox.js, reply-comment.js

### Example Scripts

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.

### Cron Integration

cd /path/to/workspace && ./scripts/browser-lock.sh run scripts/browser/task.js

Add jitterWait() at script start to randomize execution time.

### Troubleshooting

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

### Environment Variables

VarDefaultDescriptionCDP_PORTauto-discoverOverride CDP portCHROME_BINauto-detectChrome binary pathHEADLESSautotrue/false to force headless
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: swaylq
- Version: 1.0.0
## Source health
- Status: healthy
- Source download looks usable.
- Yavira can redirect you to the upstream package for this source.
- Health scope: source
- Reason: direct_download_ok
- Checked at: 2026-04-30T16:55:25.780Z
- Expires at: 2026-05-07T16:55:25.780Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/browser-automation-ultra)
- [Send to Agent page](https://openagent3.xyz/skills/browser-automation-ultra/agent)
- [JSON manifest](https://openagent3.xyz/skills/browser-automation-ultra/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/browser-automation-ultra/agent.md)
- [Download page](https://openagent3.xyz/downloads/browser-automation-ultra)