{
  "schemaVersion": "1.0",
  "item": {
    "slug": "browser-js",
    "name": "Browser Js",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/shaihazher/browser-js",
    "canonicalUrl": "https://clawhub.ai/shaihazher/browser-js",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/browser-js",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=browser-js",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "_meta.json",
      "scripts/browser.js",
      "scripts/package-lock.json",
      "scripts/package.json"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "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."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "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."
        },
        {
          "label": "Upgrade existing",
          "body": "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."
        }
      ]
    },
    "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-js"
    },
    "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."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/browser-js",
    "agentPageUrl": "https://openagent3.xyz/skills/browser-js/agent",
    "manifestUrl": "https://openagent3.xyz/skills/browser-js/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/browser-js/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "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."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "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."
      },
      {
        "label": "Upgrade existing",
        "body": "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."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "browser-js",
        "body": "Lightweight CLI that talks to Chrome via CDP (Chrome DevTools Protocol). Returns minimal, indexed output that agents can act on immediately — no accessibility tree parsing, no ref hunting."
      },
      {
        "title": "Setup",
        "body": "# Install dependency (one-time, in the skill scripts/ dir)\ncd scripts && npm install\n\n# Ensure browser is running with CDP enabled.\n# With OpenClaw:\n#   browser start profile=openclaw\n# Or manually:\n#   google-chrome --remote-debugging-port=18800 --user-data-dir=~/.browser-data\n\nThe tool connects to http://127.0.0.1:18800 by default. Override with CDP_URL env var."
      },
      {
        "title": "Alias setup (optional)",
        "body": "mkdir -p ~/.local/bin\ncat > ~/.local/bin/bjs << 'WRAPPER'\n#!/bin/bash\nexec node /path/to/scripts/browser.js \"$@\"\nWRAPPER\nchmod +x ~/.local/bin/bjs"
      },
      {
        "title": "Commands",
        "body": "bjs tabs                    List open tabs\nbjs open <url>              Navigate to URL\nbjs tab <index>             Switch to tab\nbjs newtab [url]            Open new tab\nbjs close [index]           Close tab\nbjs elements [selector]     List interactive elements (indexed)\nbjs click <index>           Click element by index\nbjs type <index> <text>     Type into element\nbjs upload <path> [selector] Upload file to input (bypasses OS dialog)\nbjs text [selector]         Extract visible page text\nbjs html <selector>         Get element HTML\nbjs eval <js>               Run JavaScript in page\nbjs screenshot [path]       Save screenshot\nbjs scroll <up|down|top|bottom> [px]\nbjs url                     Current URL\nbjs back / forward / refresh\nbjs wait <ms>\n\nCoordinate commands (cross-origin iframes, captchas, overlays):\nbjs click-xy <x> <y>       Click at page coordinates via CDP Input\nbjs click-xy <x> <y> --double   Double-click at coordinates\nbjs click-xy <x> <y> --right    Right-click at coordinates\nbjs hover-xy <x> <y>       Hover at page coordinates\nbjs drag-xy <x1> <y1> <x2> <y2>   Drag between coordinates\nbjs iframe-rect <selector> Get iframe bounding box (for click-xy targeting)"
      },
      {
        "title": "How it works",
        "body": "elements scans the page for all interactive elements (links, buttons, inputs, selects, etc.) — including those inside shadow DOM (web components). This means sites like Reddit, GitHub, and other modern SPAs that use shadow DOM are fully supported. The scan recursively pierces all shadow roots.\n\nReturns a compact numbered list:\n\n[0] (link) Hacker News → https://news.ycombinator.com/news\n[1] (link) new → https://news.ycombinator.com/newest\n[2] (input:text) q\n[3] (button) Submit\n\nThen click 3 or type 2 search query — immediately actionable, no interpretation needed.\n\nAuto-indexing: click and type auto-index elements if not already indexed. You can skip calling elements first and go straight to click/type after open. Call elements explicitly when you need to see what's on the page.\n\nAfter navigation or AJAX changes: Elements get re-indexed automatically on next click/type if stamps are stale. For manual re-index, call elements again.\n\nReal mouse events: click uses CDP Input.dispatchMouseEvent (mousePressed + mouseReleased) instead of JS .click(). This triggers React/Vue/Angular synthetic event handlers that ignore plain .click() calls. Works reliably on SPAs like Instagram, GitHub, LinkedIn."
      },
      {
        "title": "File uploads",
        "body": "upload uses CDP's DOM.setFileInputFiles to inject files directly into hidden <input type=\"file\"> elements — no OS file picker dialog. Works with Instagram, Twitter, any site with file uploads.\n\nbjs upload ~/photos/image.jpg                    # auto-finds input[type=file]\nbjs upload ~/docs/resume.pdf \"input.file-drop\"   # specific selector"
      },
      {
        "title": "Token efficiency",
        "body": "ApproachTokens per interactionNotesbjs~50-200Indexed list, 1-line responsesbrowser tool (snapshot)~2,000-5,000Full accessibility treebrowser tool + thinking~3,000-8,000Plus reasoning to find refs\n\nOver a 10-step flow: ~1,500 tokens (bjs) vs ~30,000-80,000 (browser tool)."
      },
      {
        "title": "Typical flow",
        "body": "bjs open https://example.com       # Navigate\nbjs elements                        # See what's clickable\nbjs click 5                         # Click element [5]\nbjs type 12 \"hello world\"          # Type into element [12]\nbjs text                            # Read page content\nbjs screenshot /tmp/result.png      # Verify visually"
      },
      {
        "title": "Shadow DOM support",
        "body": "bjs automatically pierces shadow DOM boundaries. Sites built with web components (Reddit, GitHub, etc.) work out of the box — elements, click, type, and text all recurse into shadow roots. No special flags needed."
      },
      {
        "title": "Coordinate commands (iframes, captchas, overlays)",
        "body": "When you can't use click by index — e.g. the target is inside a cross-origin iframe (captcha checkbox, payment form, OAuth widget) — use coordinate-based commands that dispatch real CDP Input events at the OS level. These bypass all DOM boundaries.\n\nWorkflow for clicking inside an iframe:\n\nbjs iframe-rect 'iframe[title*=\"hCaptcha\"]'    # Get bounding box\n# Output: x=95 y=440 w=302 h=76 center=(246, 478)\n\nbjs click-xy 125 458                            # Click checkbox position\n\niframe-rect returns the iframe's position on the page. Add offsets to target specific elements inside it (e.g. a checkbox is typically near the left side).\n\nOther uses:\n\nhover-xy — trigger hover menus, tooltips that need mouse position\ndrag-xy — slider controls, drag-and-drop, canvas interactions\nclick-xy --double — double-click to select text, expand items\nclick-xy --right — context menus\n\nWhen to use coordinate commands vs click:\n\nclick <index> — always preferred when the element shows up in elements\nclick-xy — only when the target is inside a cross-origin iframe or otherwise unreachable by DOM indexing"
      },
      {
        "title": "Tips",
        "body": "elements with a CSS selector narrows scope: bjs elements \".modal\"\neval runs arbitrary JS and returns the result — use for custom extraction\ntext caps at 8KB — enough for most pages, won't blow up context\nhtml <selector> caps at 10KB — for inspecting specific elements\nPipe through grep to filter: bjs elements | grep -i \"submit\\|login\""
      }
    ],
    "body": "browser-js\n\nLightweight CLI that talks to Chrome via CDP (Chrome DevTools Protocol). Returns minimal, indexed output that agents can act on immediately — no accessibility tree parsing, no ref hunting.\n\nSetup\n# Install dependency (one-time, in the skill scripts/ dir)\ncd scripts && npm install\n\n# Ensure browser is running with CDP enabled.\n# With OpenClaw:\n#   browser start profile=openclaw\n# Or manually:\n#   google-chrome --remote-debugging-port=18800 --user-data-dir=~/.browser-data\n\n\nThe tool connects to http://127.0.0.1:18800 by default. Override with CDP_URL env var.\n\nAlias setup (optional)\nmkdir -p ~/.local/bin\ncat > ~/.local/bin/bjs << 'WRAPPER'\n#!/bin/bash\nexec node /path/to/scripts/browser.js \"$@\"\nWRAPPER\nchmod +x ~/.local/bin/bjs\n\nCommands\nbjs tabs                    List open tabs\nbjs open <url>              Navigate to URL\nbjs tab <index>             Switch to tab\nbjs newtab [url]            Open new tab\nbjs close [index]           Close tab\nbjs elements [selector]     List interactive elements (indexed)\nbjs click <index>           Click element by index\nbjs type <index> <text>     Type into element\nbjs upload <path> [selector] Upload file to input (bypasses OS dialog)\nbjs text [selector]         Extract visible page text\nbjs html <selector>         Get element HTML\nbjs eval <js>               Run JavaScript in page\nbjs screenshot [path]       Save screenshot\nbjs scroll <up|down|top|bottom> [px]\nbjs url                     Current URL\nbjs back / forward / refresh\nbjs wait <ms>\n\nCoordinate commands (cross-origin iframes, captchas, overlays):\nbjs click-xy <x> <y>       Click at page coordinates via CDP Input\nbjs click-xy <x> <y> --double   Double-click at coordinates\nbjs click-xy <x> <y> --right    Right-click at coordinates\nbjs hover-xy <x> <y>       Hover at page coordinates\nbjs drag-xy <x1> <y1> <x2> <y2>   Drag between coordinates\nbjs iframe-rect <selector> Get iframe bounding box (for click-xy targeting)\n\nHow it works\n\nelements scans the page for all interactive elements (links, buttons, inputs, selects, etc.) — including those inside shadow DOM (web components). This means sites like Reddit, GitHub, and other modern SPAs that use shadow DOM are fully supported. The scan recursively pierces all shadow roots.\n\nReturns a compact numbered list:\n\n[0] (link) Hacker News → https://news.ycombinator.com/news\n[1] (link) new → https://news.ycombinator.com/newest\n[2] (input:text) q\n[3] (button) Submit\n\n\nThen click 3 or type 2 search query — immediately actionable, no interpretation needed.\n\nAuto-indexing: click and type auto-index elements if not already indexed. You can skip calling elements first and go straight to click/type after open. Call elements explicitly when you need to see what's on the page.\n\nAfter navigation or AJAX changes: Elements get re-indexed automatically on next click/type if stamps are stale. For manual re-index, call elements again.\n\nReal mouse events: click uses CDP Input.dispatchMouseEvent (mousePressed + mouseReleased) instead of JS .click(). This triggers React/Vue/Angular synthetic event handlers that ignore plain .click() calls. Works reliably on SPAs like Instagram, GitHub, LinkedIn.\n\nFile uploads\n\nupload uses CDP's DOM.setFileInputFiles to inject files directly into hidden <input type=\"file\"> elements — no OS file picker dialog. Works with Instagram, Twitter, any site with file uploads.\n\nbjs upload ~/photos/image.jpg                    # auto-finds input[type=file]\nbjs upload ~/docs/resume.pdf \"input.file-drop\"   # specific selector\n\nToken efficiency\nApproach\tTokens per interaction\tNotes\nbjs\t~50-200\tIndexed list, 1-line responses\nbrowser tool (snapshot)\t~2,000-5,000\tFull accessibility tree\nbrowser tool + thinking\t~3,000-8,000\tPlus reasoning to find refs\n\nOver a 10-step flow: ~1,500 tokens (bjs) vs ~30,000-80,000 (browser tool).\n\nTypical flow\nbjs open https://example.com       # Navigate\nbjs elements                        # See what's clickable\nbjs click 5                         # Click element [5]\nbjs type 12 \"hello world\"          # Type into element [12]\nbjs text                            # Read page content\nbjs screenshot /tmp/result.png      # Verify visually\n\nShadow DOM support\n\nbjs automatically pierces shadow DOM boundaries. Sites built with web components (Reddit, GitHub, etc.) work out of the box — elements, click, type, and text all recurse into shadow roots. No special flags needed.\n\nCoordinate commands (iframes, captchas, overlays)\n\nWhen you can't use click by index — e.g. the target is inside a cross-origin iframe (captcha checkbox, payment form, OAuth widget) — use coordinate-based commands that dispatch real CDP Input events at the OS level. These bypass all DOM boundaries.\n\nWorkflow for clicking inside an iframe:\n\nbjs iframe-rect 'iframe[title*=\"hCaptcha\"]'    # Get bounding box\n# Output: x=95 y=440 w=302 h=76 center=(246, 478)\n\nbjs click-xy 125 458                            # Click checkbox position\n\n\niframe-rect returns the iframe's position on the page. Add offsets to target specific elements inside it (e.g. a checkbox is typically near the left side).\n\nOther uses:\n\nhover-xy — trigger hover menus, tooltips that need mouse position\ndrag-xy — slider controls, drag-and-drop, canvas interactions\nclick-xy --double — double-click to select text, expand items\nclick-xy --right — context menus\n\nWhen to use coordinate commands vs click:\n\nclick <index> — always preferred when the element shows up in elements\nclick-xy — only when the target is inside a cross-origin iframe or otherwise unreachable by DOM indexing\nTips\nelements with a CSS selector narrows scope: bjs elements \".modal\"\neval runs arbitrary JS and returns the result — use for custom extraction\ntext caps at 8KB — enough for most pages, won't blow up context\nhtml <selector> caps at 10KB — for inspecting specific elements\nPipe through grep to filter: bjs elements | grep -i \"submit\\|login\""
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/shaihazher/browser-js",
    "publisherUrl": "https://clawhub.ai/shaihazher/browser-js",
    "owner": "shaihazher",
    "version": "1.5.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/browser-js",
    "downloadUrl": "https://openagent3.xyz/downloads/browser-js",
    "agentUrl": "https://openagent3.xyz/skills/browser-js/agent",
    "manifestUrl": "https://openagent3.xyz/skills/browser-js/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/browser-js/agent.md"
  }
}