Bỏ qua để đến nội dung

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.

Đâ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
  • Mở URLs
  • Navigate giữa các pages
  • Handle redirects
  • Click elements
  • Type text
  • Scroll pages
  • Hover effects
  • Chụp screenshots
  • Đọc DOM content
  • Extract data từ pages
  • UI testing
  • Form validation
  • User flow testing

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 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

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

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
"Test tất cả button trên trang home có hoạt động đúng không"

Browser Subagent sẽ:

  1. Navigate đến homepage
  2. Tìm tất cả buttons
  3. Click từng button
  4. Verify behavior
  5. Report kết quả
"Lấy danh sách sản phẩm từ trang này"

Browser Subagent sẽ:

  1. Navigate đến trang
  2. Identify product elements
  3. Extract data (tên, giá, ảnh…)
  4. Return structured data
"Đăng nhập vào dashboard và export report"

Browser Subagent sẽ:

  1. Navigate đến login
  2. Fill credentials
  3. Submit form
  4. Navigate đến reports
  5. Click export button
"Chụp screenshot của trang trước và sau khi thay đổi CSS"

Browser Subagent sẽ:

  1. Capture before screenshot
  2. Wait for CSS changes
  3. Capture after screenshot
  4. So sánh visual diff

Browser Subagent có thể record các actions thành video:

  • Format: WebP
  • Lưu trong artifacts directory
  • Có thể embed vào walkthrough

Hệ thống bảo mật 2 lớp:

  1. Denylist (server-side)

    • Google’s BadUrlsChecker
    • Block malicious URLs
  2. Allowlist (local)

    • File text local
    • Default chỉ có localhost
    • User control URLs được trust

Khi truy cập URL không trong allowlist:

  1. Agent sẽ pause và hỏi
  2. User có thể Allow once hoặc Always allow
  3. “Always allow” sẽ thêm vào allowlist

Browser Subagent rất mạnh cho:

  • End-to-end testing
  • Visual regression testing
  • User flow validation

Yêu cầu screenshots để:

  • Document UI state
  • Debug issues
  • Verify changes

Browser operations chậm hơn code operations:

  • Minimize unnecessary navigations
  • Batch related actions
  • Use headless mode khi có thể

Web pages có dynamic content:

  • Wait for elements to load
  • Handle async operations
  • Retry on failures