
chrome-automation
Automate Chrome browser tasks using agent-browser CLI. Navigate pages, fill forms, click buttons, take screenshots, extract data, and replay Chrome DevTools Recorder exports.
- Installs
- 4K
- Last 24h
- —
- Trending rank
- —
- Security
- Warn
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/zc277584121/marketing-skills --skill chrome-automation- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads chrome-automation automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
Security audits
Independent scans of the skill's instructions and bundled files.
SKILL.md
The instructions your agent reads when the skill is triggered.
Skill: Chrome Automation (agent-browser)
Automate browser tasks in the user's real Chrome session via the agent-browser CLI.
Prerequisite: agent-browser must be installed and Chrome must have remote debugging enabled. See
references/agent-browser-setup.mdif unsure.
Core Principle: Reuse the User's Existing Chrome
This skill operates on a single Chrome process — the user's real browser. There is no session management, no separate profiles, no launching a fresh Playwright browser.
Always Start by Listing Tabs
Before opening any new page, always list existing tabs first:
agent-browser --auto-connect tab list
This returns all open tabs with their index numbers, titles, and URLs. Check if the page you need is already open:
- If the target page is already open → switch to that tab directly instead of opening a new one. The user likely has it open because they are already logged in and the page is in the right state.
agent-browser --auto-connect tab <index> - If the target page is NOT open → open it in the current tab or a new tab.
agent-browser --auto-connect open <url>
Why This Matters
- The user's Chrome has their cookies, login sessions, and browser state
- Opening a new page when one is already available wastes time and may lose login state
- Many marketing platforms (social media dashboards, ad managers, CMS tools) require login — reusing an existing logged-in tab avoids re-authentication
Connection
Always use --auto-connect to connect to the user's running Chrome instance:
agent-browser --auto-connect <command>
This auto-discovers Chrome with remote debugging enabled. If connection fails, guide the user through enabling remote debugging (see references/agent-browser-setup.md).
Chrome 144+ WebSocket-Only Fallback
Chrome 144+ can expose remote debugging from chrome://inspect/#remote-debugging as a WebSocket-only endpoint. In that state the page shows Server running at: 127.0.0.1:9222, but the traditional discovery URLs return 404:
curl http://127.0.0.1:9222/json/version
curl http://127.0.0.1:9222/json/list
Older agent-browser versions such as 0.27.x may fail with No running Chrome instance found even though Chrome is ready. First try the latest CLI without changing the global install:
npx -y agent-browser@latest connect "ws://127.0.0.1:9222/devtools/browser"
npx -y agent-browser@latest tab list
If this works, use npx -y agent-browser@latest <command> for the rest of the browser task. If it fails with an engine warning or install error, upgrade Node to 24+ or install the latest agent-browser globally.
Common Workflows
1. Navigate and Interact
# List tabs to find existing pages
agent-browser --auto-connect tab list
# Switch to an existing tab (if found)
agent-browser --auto-connect tab <index>
# Or open a new page
agent-browser --auto-connect open https://example.com
agent-browser --auto-connect wait --load networkidle
# Take a snapshot to see interactive elements
agent-browser --auto-connect snapshot -i
# Click, fill, etc.
agent-browser --auto-connect click @e3
agent-browser --auto-connect fill @e5 "some text"
2. Extract Data from a Page
# Get all text content
agent-browser --auto-connect get text body
# Take a screenshot for visual inspection
agent-browser --auto-connect screenshot
# Execute JavaScript for structured data
agent-browser --auto-connect eval "JSON.stringify(document.querySelectorAll('table tr').length)"
3. Replay a Chrome DevTools Recording
The user may provide a recording exported from Chrome DevTools Recorder (JSON, Puppeteer JS, or @puppeteer/replay JS format). See Replaying Recordings below.
Step-by-Step Interaction Guide
Taking Snapshots
Use snapshot -i to see all interactive elements with refs (@e1, @e2, ...):
agent-browser --auto-connect snapshot -i
The output lists each interactive element with its role, text, and ref. Use these refs for subsequent actions.
Step Type Mapping
| Action | Command |
|---|---|
| Navigate | agent-browser --auto-connect open <url> (optionally wait --load networkidle, but some sites like Reddit never reach networkidle — skip if open already shows the page title) |
| Click | snapshot -i → find ref → click @eN |
| Fill standard input | click @eN → fill @eN "text" |
| Fill rich text editor | click @eN → keyboard inserttext "text" |
| Press key | press <key> (Enter, Tab, Escape, etc.) |
| Scroll | scroll down <amount> or scroll up <amount> |
| Wait for element | wait @eN or wait "<css-selector>" |
| Screenshot | screenshot or screenshot --annotate |
| Get page text | get text body |
| Get current URL | get url |
| Run JavaScript | eval <js> |
How to Distinguish Input Types
- Standard input/textarea → use
fill - Contenteditable div / rich text editor (LinkedIn message box, Gmail compose, Slack, CMS editors) → click/focus first, then use
keyboard inserttext
Ref Lifecycle
Refs (@e1, @e2, ...) are invalidated when the page changes. Always re-snapshot after:
- Clicking links or buttons that trigger navigation
- Submitting forms
- Triggering dynamic content loads (AJAX, SPA navigation)
Verification
After each significant action, verify the result:
agent-browser --auto-connect snapshot -i # check interactive state
agent-browser --auto-connect screenshot # visual verification
Replaying Recordings
Accepted Formats
-
JSON (recommended) — structured, can be read progressively:
# Count steps jq '.steps | length' recording.json # Read first 5 steps jq '.steps[0:5]' recording.json -
@puppeteer/replay JS (
import { createRunner }) -
Puppeteer JS (
require('puppeteer'),page.goto,Locator.race)
How to Replay
- Parse the recording — understand the full intent before acting. Summarize what the recording does.
- List tabs first — check if the target page is already open.
- Navigate — execute
navigatesteps, reusing existing tabs when possible. - For each interaction step:
- Take a snapshot (
snapshot -i) to see current interactive elements - Match the recording's
aria/...selectors against the snapshot - Fall back to
text/..., then CSS class hints, then screenshot - Do not rely on ember IDs, numeric IDs, or exact XPaths — these change every page load
- Take a snapshot (
- Verify after each step — snapshot or screenshot to confirm
Iframe-Heavy Sites
snapshot -i operates on the main frame only and cannot penetrate iframes. Sites like LinkedIn, Gmail, and embedded editors render content inside iframes.
Detecting Iframe Issues
snapshot -ireturns unexpectedly short or empty results- Recording references elements not appearing in snapshot output
get text bodycontent doesn't match what a screenshot shows
Workarounds
-
Use
evalto access iframe content:agent-browser --auto-connect eval --stdin <<'EVALEOF' const frame = document.querySelector('iframe[data-testid="interop-iframe"]'); const doc = frame.contentDocument; const btn = doc.querySelector('button[aria-label="Send"]'); btn.click(); EVALEOFNote: Only works for same-origin iframes.
-
Use
keyboardfor blind input: If the iframe element has focus,keyboard inserttext "..."sends text regardless of frame boundaries. -
Use
get text bodyto read full page content including iframes. -
Use
screenshotfor visual verification when snapshot is unreliable.
When to Ask the User
If workarounds fail after 2 attempts on the same step, pause and explain:
- The page uses iframes that cannot be accessed via snapshot
- Which element you need and what you expected
- Ask the user to perform that step manually, then continue
Handling Unexpected Situations
Handle Automatically (do not stop):
- Popups or banners → dismiss them (
find text "Dismiss" clickorfind text "Close" click) - Cookie consent dialogs → accept or dismiss
- Tooltip overlays → close them first
- Element not in snapshot → try
find text "..." click, or scroll to reveal withscroll down 300
Pause and Ask the User:
- Login / authentication is required
- A CAPTCHA appears
- Page structure is completely different from expected
- A destructive action is about to happen (deleting data, sending real content) — confirm first
- Stuck for more than 2 attempts on the same step
- All iframe workarounds have failed
When pausing, explain clearly: what step you are on, what you expected, and what you see.
Key Commands Reference
| Command | Description |
|---|---|
tab list | List all open tabs with index, title, and URL |
tab <index> | Switch to an existing tab by index |
tab new | Open a new empty tab |
tab close | Close the current tab |
open <url> | Navigate to URL |
snapshot -i | List interactive elements with refs |
click @eN | Click element by ref |
fill @eN "text" | Clear and fill standard input/textarea |
type @eN "text" | Type without clearing |
keyboard inserttext "text" | Insert text (best for contenteditable) |
press <key> | Press keyboard key |
scroll down/up <amount> | Scroll page in pixels |
wait @eN | Wait for element to appear |
wait --load networkidle | Wait for network to settle |
wait <ms> | Wait for a duration |
screenshot [path] | Take screenshot |
screenshot --annotate | Screenshot with numbered labels |
eval <js> | Execute JavaScript in page |
get text body | Get all text content |
get url | Get current URL |
set viewport <w> <h> | Set viewport size |
find text "..." click | Semantic find and click |
close | Close browser session |
Known Limitations
- Iframe blindness:
snapshot -icannot see inside iframes. See Iframe-Heavy Sites. find textstrict mode: Fails when multiple elements match. Usesnapshot -ito locate the specific ref instead.fillvs contenteditable:fillonly works on<input>and<textarea>. For rich text editors, usekeyboard inserttext.evalis main-frame only: To interact with iframe content, traverse viadocument.querySelector('iframe').contentDocument...
Multi-Platform Operations
When the user requests an action across multiple platforms (e.g., "publish this article to Dev.to, LinkedIn, and X"), do NOT attempt all platforms in a single conversation. Instead, launch sequential subagents/workers, one per platform. Selecting this skill is explicit permission to use subagents/workers for this multi-platform workflow.
Why Subagents
Each platform operation consumes ~25-40K tokens (reference file + snapshots + interactions). Running 3-5 platforms in one context risks hitting the context limit and degrading late-platform accuracy. Each subagent/worker gets its own fresh context window.
How to Execute
- Prepare the content — confirm the post text, title, tags, and any platform-specific adaptations with the user.
- For each platform, launch a subagent/worker with a prompt that includes:
- The full content to publish
- Instructions to read the relevant reference file (e.g.,
Read /path/to/skills/chrome-automation/references/x.md) - Instructions to read the agent-browser skill file for command reference
- The specific task (post, comment, reply, etc.)
- Any platform-specific instructions (e.g., "use these hashtags on LinkedIn")
- Run subagents/workers sequentially (one at a time), because they all share the same Chrome browser via
--auto-connect. Parallel subagents/workers would cause tab conflicts. - After each subagent/worker completes, report the result to the user before launching the next one.
Prompt Template for Subagents
You are automating a browser task on [PLATFORM].
First, read these files for context:
- /absolute/path/to/skills/chrome-automation/references/[platform].md
- The installed agent-browser skill file, if available (agent-browser command reference)
Then connect to the user's Chrome browser using `agent-browser --auto-connect` and perform the following task:
[TASK DESCRIPTION]
Content to publish:
[CONTENT]
Important:
- Always list tabs first (`tab list`) and reuse existing logged-in tabs
- Re-snapshot after every navigation or action
- Confirm with the user before submitting/publishing (destructive action)
- If login is required or a CAPTCHA appears, stop and explain
When NOT to Use Subagents
- Single platform — just do it directly in the current conversation.
- Read-only tasks (browsing, searching, extracting data) — context usage is lighter; a single conversation can handle 2-3 platforms.
Platform References
When automating tasks on specific platforms, consult the relevant reference document for page structure details, common operations, and known quirks:
| Platform | Reference | Key Notes |
|---|---|---|
references/reddit.md | Custom faceplate-* components; networkidle never reached; unlabeled comment textbox; find text fails due to duplicate elements | |
| X (Twitter) | references/x.md | open often times out (use tab list to reuse existing tabs); click timestamp for post detail (not username); DraftJS contenteditable input (data-testid="tweetTextarea_0"); avoid networkidle |
references/linkedin.md | Ember.js SPA; Enter submits comments (use Shift+Enter for newlines); comment box and compose box share the same label; avoid networkidle; messaging overlay may block content | |
| Dev.to | references/devto.md | Fast server-rendered HTML (Forem/Rails); standard <textarea> for comments/posts (Markdown); 5 reaction types; Algolia-powered search; networkidle works normally |
| Hacker News | references/hackernews.md | Minimal plain HTML; all form fields are unlabeled; link "reply" navigates to separate page; networkidle works instantly; rate limiting on posts/comments |
For installation and Chrome setup instructions, see
references/agent-browser-setup.md.
FAQ
What does the chrome-automation skill do?
Automate Chrome browser tasks using agent-browser CLI. Navigate pages, fill forms, click buttons, take screenshots, extract data, and replay Chrome DevTools Recorder exports.
How do I install chrome-automation?
Run npx skills add https://github.com/zc277584121/marketing-skills --skill chrome-automation in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/chrome-automation/ (personal) or .claude/skills/chrome-automation/ (project).
Which AI agents can use chrome-automation?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is chrome-automation safe to install?
Security partners have reviewed it: Gen Agent Trust Hub passed; Socket passed; Snyk flagged items to review; Runlayer flagged items to review; ZeroLeaks passed. As with any skill, read the SKILL.md and bundled scripts before installing.
Who maintains chrome-automation?
It is published by zc277584121 in zc277584121/marketing-skills. It has 3,969 recorded installs.
More from zc277584121/marketing-skills
remove-ai-style
zc277584121/marketing-skills
Aggressively rewrite Chinese or English prose to remove AI-generated patterns. Use for de-AI polishing, natural-language rewrites, robotic or formulaic writing, and publication cleanup. Always run the bundled deterministic Markdown analyzer first, remove every editable exclamation mark, dash, and formulaic binary contrast, inspect every other reported location, then read the full article for semantic patterns the rules cannot enumerate.
browser-screenshot
zc277584121/marketing-skills
Take focused, region-specific screenshots from web pages using a dedicated headed Chrome profile with persistent login state. Navigates to the right page based on user context (URL, search query, social media post), locates the target region via DOM selectors, and crops to a clean, focused screenshot without attaching to the user's daily browser.
content-rewrite
zc277584121/marketing-skills
Adapt and rewrite content for different platforms (LinkedIn, X, Reddit, English blog, WeChat). Each platform has its own tone, format, and length requirements.
mermaid-to-image
zc277584121/marketing-skills
Convert Mermaid code blocks in Markdown files to PNG images using the mermaid.ink API.
image-generation
zc277584121/marketing-skills
Generate illustration images for articles and documentation with a Codex-first workflow, OpenAI API fallback, and Gemini fallback.
raw-video-processing
zc277584121/marketing-skills
Post-process raw screen recordings by removing silent segments and applying speed adjustments. Uses FFmpeg-based Python scripts to optimize video pacing automatically.
Popular productivity & automation skills
agent-browser
vercel-labs/agent-browser
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.
lark-doc
open.feishu.cn
飞书云文档(Docx / Wiki)内容操作:读取、创建、编辑文档,插入或下载图片附件,以及操作思维笔记。用户提供文档 URL/token(包括 doubao.com 的 /docx/、/wiki/)时使用;按 URL 路径/token 而非域名路由;/page/ 是妙搭应用,非飞书云文档。文档内嵌资源按读取参考中的统一规则分流。独立评论操作走 lark-drive;随正文读取评论使用 docs +fetch。表格或 Base 内部数据操作不在本 skill。
lark-base
open.feishu.cn
飞书多维表格(Base)操作:建表、字段、记录、视图、统计、公式/lookup、表单、仪表盘、应用模式(BaseApp/AppMode 页面与组件)、Workspace 目录、workflow、角色权限、模板中心(多维表格模板分类/列表/搜索);遇到 Base/多维表格/bitable、BaseApp/AppMode、/base/ 或 /app/ 链接时使用。BaseApp 不走 lark-apps;文件导入/导出转 lark-drive,认证/授权转 lark-shared。
lark-drive
open.feishu.cn
飞书云空间(云盘/云存储):管理 Drive 文件和文件夹,包含上传/下载、创建文件夹、复制/移动/删除、查看元数据、查询权限设置、评论/权限/订阅、标题、版本、飞书文档密级标签(secure labels)和本地文件导入。用户需要整理云盘目录、处理云空间资源 URL/token、判断链接类型/真实 token/标题,或导入 Word/Markdown/Excel/CSV/PPTX/.base 为 docx/sheet/bitable/slides 时使用;doubao.com 云空间 URL/token 也按资源路径和 token 路由,不回退 WebFetch。不负责:文档内容编辑(走 lark-doc)、表格/Base 表内数据操作(走 lark-sheets/lark-base)、知识空间节点/成员管理(走 lark-wiki)、原生 Markdown 文件读写/patch/diff(走 lark-markdown)。
lark-shared
open.feishu.cn
Use for lark-cli setup/auth tasks: auth login/status/logout, user vs bot identity, business-domain permissions (--domain, including all/docs/drive), missing scopes, revoking authorization, or handling notice JSON.
lark-im
open.feishu.cn
飞书即时通讯:收发消息和管理群聊。发送和回复消息、搜索聊天记录、管理群聊成员、上传下载图片和文件、管理表情回复、发送应用内/短信/电话加急、发送和处理交互卡片(Interactive Card)、监听卡片按钮回调(card.action.trigger)。当用户需要发消息、查看或搜索聊天记录、下载聊天中的文件、查看群成员、搜索群、创建群聊或话题群、管理标记数据、管理 Feed 置顶(添加/移除/查询置顶会话)、管理标签数据、处理卡片回调时使用。