51 lines
1.7 KiB
Markdown
51 lines
1.7 KiB
Markdown
# Browser Plugin (`browser-plugin`)
|
|
|
|
The `browser-plugin` provides real-time Chrome browser automation, tab inspection, accessibility auditing, DOM interaction, element screenshotting, and CDP trace performance profiling for Antigravity AI agents.
|
|
|
|
---
|
|
|
|
## Architecture & Integration Options
|
|
|
|
### 1. Direct MCP Tool Calling (Fastest)
|
|
|
|
Invoke browser tools directly from any active turn via `call_mcp_tool`:
|
|
|
|
```json
|
|
call_mcp_tool(
|
|
ServerName="browser-tools",
|
|
ToolName="chrome_read_page",
|
|
Arguments={"tabId": 863242845}
|
|
)
|
|
```
|
|
|
|
- **Use when**: You need a quick DOM lookup, single screenshot, or single tab navigation while pair-programming.
|
|
|
|
### 2. Skill-Guided Workflows (`browser-automation`)
|
|
|
|
Activate the `browser-automation` skill in your turn for inline workflow guidance and DOM inspection strategies.
|
|
|
|
- **Use when**: Performing multi-step browser interactions (form fills, visual regression checks, CDP trace analysis).
|
|
|
|
### 3. Subagent Delegation (`browser:browser-agent` / `self`)
|
|
|
|
Delegate long-running or multi-page browser exploration to a dedicated subagent via `invoke_subagent`:
|
|
|
|
```json
|
|
invoke_subagent(Subagents=[{
|
|
"TypeName": "browser:browser-agent",
|
|
"Role": "Browser Automation Agent",
|
|
"Prompt": "Inspect open tabs, navigate to target page, and report accessibility tree."
|
|
}])
|
|
```
|
|
|
|
- **Use when**: Offloading heavy background web exploration, batch screenshot capture, or automated E2E testing without cluttering the main conversation window.
|
|
|
|
---
|
|
|
|
## Plugin Contents
|
|
|
|
- **`plugin.json`**: Plugin manifest metadata.
|
|
- **`.mcp.json`**: Endpoint definition (`http://127.0.0.1:12010/p/browser/mcp`).
|
|
- **`agents/browser_agent.py`**: Agent builder for `browser:browser-agent`.
|
|
- **`skills/browser-automation/SKILL.md`**: Skill documentation and decision matrix.
|