Browser Subagent
Browser Subagent là agent chuyên biệt để thực hiện các tác vụ trên trình duyệt web.
Browser Subagent là gì?
Đây là một sub-agent chuyên về:
- Điều khiển trình duyệt Chrome
- Thực hiện UI testing
- Đọc và tương tác với web content
- Automation các workflow trên web
Khả năng
🌐 Navigation
- Mở URLs
- Navigate giữa các pages
- Handle redirects
🖱️ Interactions
- Click elements
- Type text
- Scroll pages
- Hover effects
📸 Capture
- Chụp screenshots
- Đọc DOM content
- Extract data từ pages
🧪 Testing
- UI testing
- Form validation
- User flow testing
Cách sử dụng
Agent chính sẽ delegate các browser tasks cho Browser Subagent:
User: "Test xem form login hoạt động đúng không"
Agent: Delegating to Browser Subagent...
Browser Subagent:
1. Navigate to /login
2. Fill email field
3. Fill password field
4. Click submit button
5. Verify redirect to dashboard
6. Capture screenshot
Result: Login flow working correctly ✅Browser Tools
Browser Subagent có các tools riêng:
| Tool | Mô tả |
|---|---|
open_browser_url | Mở URL mới |
browser_get_dom | Lấy DOM structure |
execute_browser_javascript | Chạy JS trên page |
browser_click | Click element |
browser_type | Nhập text |
browser_screenshot | Chụp screenshot |
read_browser_page | Đọc nội dung page |
Yêu cầu
Chrome Extension
Browser Subagent yêu cầu Antigravity Chrome Extension:
- Cho phép Agent access browser
- Cho phép cancel browser tasks
- Cho phép chuyển focus về Antigravity
Separate Chrome Profile
Antigravity sử dụng Chrome profile riêng:
- Không share cookies với profile thường
- Sign-ins trong profile này được lưu
- Hiển thị như dock icon riêng
Use Cases
UI Testing
"Test tất cả button trên trang home có hoạt động đúng không"Browser Subagent sẽ:
- Navigate đến homepage
- Tìm tất cả buttons
- Click từng button
- Verify behavior
- Report kết quả
Data Extraction
"Lấy danh sách sản phẩm từ trang này"Browser Subagent sẽ:
- Navigate đến trang
- Identify product elements
- Extract data (tên, giá, ảnh…)
- Return structured data
Web Automation
"Đăng nhập vào dashboard và export report"Browser Subagent sẽ:
- Navigate đến login
- Fill credentials
- Submit form
- Navigate đến reports
- Click export button
Visual Verification
"Chụp screenshot của trang trước và sau khi thay đổi CSS"Browser Subagent sẽ:
- Capture before screenshot
- Wait for CSS changes
- Capture after screenshot
- So sánh visual diff
Browser Recordings
Browser Subagent có thể record các actions thành video:
- Format: WebP
- Lưu trong artifacts directory
- Có thể embed vào walkthrough
Security
Allowlist / Denylist
Hệ thống bảo mật 2 lớp:
-
Denylist (server-side)
- Google’s BadUrlsChecker
- Block malicious URLs
-
Allowlist (local)
- File text local
- Default chỉ có
localhost - User control URLs được trust
Approval Flow
Khi truy cập URL không trong allowlist:
- Agent sẽ pause và hỏi
- User có thể Allow once hoặc Always allow
- “Always allow” sẽ thêm vào allowlist
Best Practices
✅ Sử dụng cho UI testing
Browser Subagent rất mạnh cho:
- End-to-end testing
- Visual regression testing
- User flow validation
✅ Combine với screenshots
Yêu cầu screenshots để:
- Document UI state
- Debug issues
- Verify changes
⚠️ Lưu ý performance
Browser operations chậm hơn code operations:
- Minimize unnecessary navigations
- Batch related actions
- Use headless mode khi có thể
⚠️ Handle dynamic content
Web pages có dynamic content:
- Wait for elements to load
- Handle async operations
- Retry on failures
Last updated on