dev-browser
Skill này làm gì
Agent này có thể điều khiển trình duyệt web cho bạn. Nó có thể truy cập trang web, điền biểu mẫu, chụp ảnh màn hình các trang và thu thập thông tin.
Khi nào nên dùng
- ✓Khi bạn muốn AI điền một biểu mẫu trực tuyến.
- ✓Khi bạn cần chụp ảnh màn hình một trang web.
- ✓Khi bạn muốn AI thu thập dữ liệu từ một trang web.
Liên kết skill
https://github.com/code-yeongyu/oh-my-openagent/blob/dev/packages/skills-loader-core/src/features/builtin-skills/dev-browser/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Truy cập trang web X, điền biểu mẫu liên hệ với thông tin Y, và chụp ảnh màn hình trang xác nhận.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent hoạt động bằng cách mở một trình duyệt (hoặc kết nối với một trình duyệt đang mở) và làm theo các chỉ dẫn của bạn, như bấm nút hoặc gõ chữ.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Dev Browser Skill
Browser automation that maintains page state across script executions. Write small, focused scripts to accomplish tasks incrementally. Once you've proven out part of a workflow and there is repeated work to be done, you can write a script to do the repeated work in a single execution.
Choosing Your Approach
- Local/source-available sites: Read the source code first to write selectors directly
- Unknown page layouts: Use
getAISnapshot()to discover elements andselectSnapshotRef()to interact with them - Visual feedback: Take screenshots to see what the user sees
Setup
Installation: See references/installation.md for detailed setup instructions including Windows support.
Two modes available. Ask the user if unclear which to use.
Standalone Mode (Default)
Launches a new Chromium browser for fresh automation sessions.
./skills/dev-browser/server.sh &
Add --headless flag if user requests it. Wait for the Ready message before running scripts.
Extension Mode
Connects to user's existing Chrome browser. Use this when:
- The user is already logged into sites and wants you to do things behind an authed experience that isn't local dev.
- The user asks you to use the extension
Important: The core flow is still the same. You create named pages inside of their browser.
Start the relay server:
cd skills/dev-browser && npm i && npm run start-extension &
Wait for Waiting for extension to connect... followed by Extension connected in the console. To know that a client has connected and the browser is ready to be controlled.
Workflow:
- Scripts call
client.page("name")just like the normal mode to create new pages / connect to existing ones. - Automation runs on the user's actual browser session
If the extension hasn't connected yet, tell the user to launch and activate it. Download link: https://github.com/SawyerHood/dev-browser/releases
Writing Scripts
Run all scripts from
skills/dev-browser/directory. The@/import alias requires this directory's config.
Execute scripts inline using heredocs:
cd skills/dev-browser && npx tsx <<'EOF'
import { connect, waitForPageLoad } from "@/client.js";
const client = await connect();
// Create page with custom viewport size (optional)
const page = await client.page("example", { viewport: { width: 1920, height: 1080 } });
await page.goto("https://example.com");
await waitForPageLoad(page);
console.log({ title: await page.title(), url: page.url() });
await client.disconnect();
EOF
Write to tmp/ files only when the script needs reuse, is complex, or user explicitly requests it.
Key Principles
- Small scripts: Each script does ONE thing (navigate, click, fill, check)
- Evaluate state: Log/return state at the end to decide next steps
- Descriptive page names: Use
"checkout","login", not"main" - Disconnect to exit:
await client.disconnect()- pages persist on server - Plain JS in evaluate:
page.evaluate()runs in browser - no TypeScript syntax
Workflow Loop
Follow this pattern for complex tasks:
- Write a script to perform one action
- Run it and observe the output
- Evaluate - did it work? What's the current state?
- Decide - is the task complete or do we need another script?
- Repeat until task is done
No TypeScript in Browser Context
Code passed to page.evaluate() runs in the browser, which doesn't understand TypeScript:
// ✅ Correct: plain JavaScript
const text = await page.evaluate(() => {
return document.body.innerText;
});
// ❌ Wrong: TypeScript syntax will fail at runtime
const text = await page.evaluate(() => {
const el: HTMLElement = document.body; // Type annotation breaks in browser!
return el.innerText;
});
Scraping Data
For scraping large datasets, intercept and replay network requests rather than scrolling the DOM. See references/scraping.md for the complete guide covering request capture, schema discovery, and paginated API replay.
Client API
const client = await connect();
// Get or create named page (viewport only applies to new pages)
const page = await client.page("name");
const pageWithSize = await client.page("name", { viewport: { width: 1920, height: 1080 } });
const pages = await client.list(); // List all page names
…
Câu hỏi thường gặp
Làm sao nó biết phải bấm vào đâu hoặc gõ gì?
Nó dùng mô tả trang và các tham chiếu đặc biệt để tìm đúng phần tử, như nút và ô nhập liệu.
Nó có thể dùng các tài khoản bạn đã đăng nhập không?
Có, nếu bạn dùng chế độ tiện ích mở rộng, nó có thể tương tác với các trang mà bạn đã đăng nhập trên trình duyệt.
Điều gì xảy ra với các trang nó đã truy cập?
Các trang có thể được giữ mở để bạn thực hiện các thao tác khác sau đó, ngay cả khi tác vụ chính đã hoàn thành.
Chi tiết
Mô tả gốc của tác giả
Browser automation with persistent page state. Use when users ask to navigate websites, fill forms, take screenshots, extract web data, test web apps, or automate browser workflows. Trigger phrases include "go to [url]", "click on", "fill out the form", "take a screenshot", "scrape", "automate", "test the website", "log into", or any browser interaction request.
Độ phổ biến
- Sao GitHub
- 70k
- Vị trí xếp hạng
- #3143
- Giấy phép
- NOASSERTION
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
comment-checker
70kGiúp agent của bạn hiểu và phản hồi các nhận xét từ công cụ kiểm tra bình luận tự động. Hữu ích khi xử lý kết quả từ việc rà soát mã hoặc nội dung tự động.
lcx-contribute-bug-fix
70kGiúp agent của bạn đóng góp bản sửa lỗi cho các dự án liên quan đến LazyCodex. Agent tạo issue hoặc pull request để đảm bảo chất lượng mã.
lcx-doctor
70kCho phép agent của bạn kiểm tra tình trạng cài đặt LazyCodex và Codex CLI. Hữu ích khi hệ thống hoạt động lạ sau khi cập nhật hoặc thay đổi.
lcx-report-bug
70kGiúp agent của bạn báo lỗi chi tiết cho các dự án LazyCodex. Agent tạo issue với thông tin hữu ích để lập trình viên sửa vấn đề.
Skill tương tự
test-driven-development
311kDạy agent của bạn viết kiểm thử thất bại trước, xem nó thất bại, rồi viết đoạn mã ngắn nhất để vượt qua trước khi làm bất kỳ tính năng hay bản sửa nào.
verification-before-completion
311kDạy agent của bạn chạy kiểm tra thực tế và đọc kết quả đầu ra trước khi khẳng định một việc, bản sửa hoặc bản build đã hoàn thành hay vượt qua.
migrate-to-shoehorn
310kThay các ép kiểu rủi ro trong tệp kiểm thử bằng thư viện shoehorn, để các bài kiểm thử dùng dữ liệu một phần vẫn qua được kiểm tra kiểu.