|
| 1 | +--- |
| 2 | +name: browser-automation |
| 3 | +description: This skill should be used when the user asks about browser automation, testing web pages, scraping content, filling forms, taking screenshots, or monitoring console/network activity. Activates for E2E testing, web scraping, form automation, or debugging web applications. |
| 4 | +--- |
| 5 | + |
| 6 | +When the user asks about browser automation, use Firefox DevTools MCP to control a real Firefox browser. |
| 7 | + |
| 8 | +## When to Use This Skill |
| 9 | + |
| 10 | +Activate this skill when the user: |
| 11 | + |
| 12 | +- Wants to automate browser interactions ("Fill out this form", "Click the login button") |
| 13 | +- Needs E2E testing ("Test the checkout flow", "Verify the login works") |
| 14 | +- Requests web scraping ("Extract prices from this page", "Get all links") |
| 15 | +- Needs screenshots ("Screenshot this page", "Capture the error state") |
| 16 | +- Wants to debug ("Check for JS errors", "Show failed network requests") |
| 17 | + |
| 18 | +## Core Workflow |
| 19 | + |
| 20 | +### Step 1: Navigate and Snapshot |
| 21 | + |
| 22 | +``` |
| 23 | +navigate_page url="https://example.com" |
| 24 | +take_snapshot |
| 25 | +``` |
| 26 | + |
| 27 | +The snapshot returns a DOM representation with UIDs (e.g., `e42`) for each interactive element. |
| 28 | + |
| 29 | +### Step 2: Interact with Elements |
| 30 | + |
| 31 | +Use UIDs from the snapshot: |
| 32 | + |
| 33 | +``` |
| 34 | +fill_by_uid uid="e5" text="user@example.com" |
| 35 | +click_by_uid uid="e8" |
| 36 | +``` |
| 37 | + |
| 38 | +### Step 3: Re-snapshot After Changes |
| 39 | + |
| 40 | +DOM changes invalidate UIDs. Always re-snapshot after: |
| 41 | +- Page navigation |
| 42 | +- Form submissions |
| 43 | +- Dynamic content loads |
| 44 | + |
| 45 | +``` |
| 46 | +take_snapshot # Get fresh UIDs |
| 47 | +``` |
| 48 | + |
| 49 | +## Quick Reference |
| 50 | + |
| 51 | +| Task | Tools | |
| 52 | +|------|-------| |
| 53 | +| Navigate | `navigate_page` | |
| 54 | +| See DOM | `take_snapshot` | |
| 55 | +| Click | `click_by_uid` | |
| 56 | +| Type | `fill_by_uid`, `fill_form_by_uid` | |
| 57 | +| Screenshot | `screenshot_page`, `screenshot_by_uid` | |
| 58 | +| Debug | `list_console_messages`, `list_network_requests` | |
| 59 | + |
| 60 | +## Guidelines |
| 61 | + |
| 62 | +- **Always snapshot first**: UIDs only exist after `take_snapshot` |
| 63 | +- **Re-snapshot after DOM changes**: UIDs become stale after interactions |
| 64 | +- **Check for errors**: Use `list_console_messages level="error"` to catch JS issues |
| 65 | +- **Firefox only**: This MCP controls Firefox, not Chrome or Safari |
0 commit comments