---
name: Browser
description: Web automation, cookies, authenticated browsing
category: Browser
tools: [browser_navigate, browser_snapshot, browser_click, browser_type, browser_inject_cookies, browser_drag, browser_file_upload, browser_handle_dialog, browser_resize, browser_console_messages, browser_network_requests, browser_install, browser_pdf_save, browser_mouse_click, browser_mouse_move, browser_mouse_drag, browser_mouse_wheel]
binaries: [npx]
---

# Browser Skills

Tools for web automation using Playwright.

## Navigation & Content

### browser_navigate
Navigate the browser to a URL.

```json
{
  "name": "browser_navigate",
  "parameters": {
    "url": "string (required) - URL to navigate to"
  }
}
```

**Example:**
```
browser_navigate(url="https://github.com")
browser_navigate(url="https://amazon.com/cart")
```

---

### browser_snapshot
Get an accessibility snapshot of the current page. Returns page content with element references (refs) for interaction.

```json
{
  "name": "browser_snapshot",
  "parameters": {}
}
```

**Example output:**
```
[page] Amazon.com Shopping Cart
  [heading] Shopping Cart
  [text] 3 items in your cart
  [link ref="e5"] Proceed to checkout
  [button ref="e8"] Delete
  [textbox ref="e12"] Quantity
```

Use the `ref` values with `browser_click` and `browser_type`.

---

## Interaction

### browser_click
Click on an element using its ref from the snapshot.

```json
{
  "name": "browser_click",
  "parameters": {
    "ref": "string (required) - Element reference (e.g., 'e5')",
    "element": "string (optional) - Element description for fallback"
  }
}
```

**Example:**
```
browser_click(ref="e5")
browser_click(ref="e8", element="Delete button")
```

---

### browser_type
Type text into an input field.

```json
{
  "name": "browser_type",
  "parameters": {
    "ref": "string (required) - Element reference",
    "text": "string (required) - Text to type",
    "submit": "boolean (optional) - Press Enter after typing"
  }
}
```

**Example:**
```
browser_type(ref="e12", text="2")
browser_type(ref="search-box", text="laptop", submit=true)
```

---

## Cookies (Authenticated Access)

To access authenticated sites (Amazon, GitHub, etc.), inject cookies from your local browser.

### browser_list_cookies
List cookies from local browsers for a domain.

```json
{
  "name": "browser_list_cookies",
  "parameters": {
    "domain": "string (required) - Domain to get cookies for",
    "browser": "string (optional) - Browser: 'chrome', 'arc', 'firefox', 'safari'"
  }
}
```

**Example:**
```
browser_list_cookies(domain="amazon.com")
browser_list_cookies(domain="github.com", browser="chrome")
```

---

### browser_inject_cookies
Inject cookies from local browser into Playwright session.

```json
{
  "name": "browser_inject_cookies",
  "parameters": {
    "domain": "string (required) - Domain to inject cookies for",
    "browser": "string (optional) - Source browser"
  }
}
```

**Example:**
```
browser_inject_cookies(domain="amazon.com")
```

**Note:** User must be logged into the site in their local browser for this to work.

---

### browser_save_cookies_state
Save current cookies to a storage state file.

```json
{
  "name": "browser_save_cookies_state",
  "parameters": {
    "path": "string (required) - Path to save state file"
  }
}
```

---

## Workflow: Accessing Authenticated Sites

1. **Inject cookies** from user's browser:
   ```
   browser_inject_cookies(domain="amazon.com")
   ```

2. **Navigate** to the page:
   ```
   browser_navigate(url="https://amazon.com/cart")
   ```

3. **Get page content**:
   ```
   browser_snapshot()
   ```

4. **Interact** with elements:
   ```
   browser_click(ref="e5")
   browser_type(ref="e12", text="2")
   ```

---

## Advanced Interaction

### browser_drag
Drag one element to another.

```json
{
  "name": "browser_drag",
  "parameters": {
    "startRef": "string (required) - Source element ref",
    "startElement": "string (optional) - Source description",
    "endRef": "string (required) - Target element ref",
    "endElement": "string (optional) - Target description"
  }
}
```

---

### browser_file_upload
Upload files via a file chooser dialog (click the upload button first).

```json
{
  "name": "browser_file_upload",
  "parameters": {
    "paths": "array of strings (required) - Absolute file paths to upload"
  }
}
```

---

### browser_handle_dialog
Handle browser dialogs (alert, confirm, prompt).

```json
{
  "name": "browser_handle_dialog",
  "parameters": {
    "accept": "boolean (required) - Accept or dismiss the dialog",
    "promptText": "string (optional) - Text for prompt dialogs"
  }
}
```

---

### browser_resize
Resize the browser viewport.

```json
{
  "name": "browser_resize",
  "parameters": {
    "width": "integer (required) - Width in pixels",
    "height": "integer (required) - Height in pixels"
  }
}
```

---

## Debugging & Monitoring

### browser_console_messages
Get browser console messages, optionally filtered by level.

```json
{
  "name": "browser_console_messages",
  "parameters": {
    "level": "string (optional) - 'error', 'warning', 'info', or 'debug'"
  }
}
```

---

### browser_network_requests
Get network requests made by the page.

```json
{
  "name": "browser_network_requests",
  "parameters": {
    "includeStatic": "boolean (optional) - Include images, fonts, CSS (default: false)"
  }
}
```

---

### browser_install
Install Playwright browser binaries. Use when browser launch fails.

```json
{
  "name": "browser_install",
  "parameters": {}
}
```

---

## PDF Export (requires --caps=pdf)

### browser_pdf_save
Save the current page as a PDF file.

```json
{
  "name": "browser_pdf_save",
  "parameters": {
    "filename": "string (optional) - Output filename (default: 'page.pdf')"
  }
}
```

---

## Vision/Coordinate Tools (requires --caps=vision)

These tools operate on raw pixel coordinates instead of element refs. Useful when accessibility refs are not available.

### browser_mouse_click
Click at specific x,y coordinates.

```json
{
  "name": "browser_mouse_click",
  "parameters": {
    "x": "integer (required) - X coordinate",
    "y": "integer (required) - Y coordinate",
    "button": "string (optional) - 'left', 'right', or 'middle'",
    "clickCount": "integer (optional) - 1=single, 2=double, 3=triple"
  }
}
```

---

### browser_mouse_move
Move the mouse to specific coordinates.

```json
{
  "name": "browser_mouse_move",
  "parameters": {
    "x": "integer (required)",
    "y": "integer (required)"
  }
}
```

---

### browser_mouse_drag
Drag from one point to another by coordinates.

```json
{
  "name": "browser_mouse_drag",
  "parameters": {
    "startX": "integer (required)",
    "startY": "integer (required)",
    "endX": "integer (required)",
    "endY": "integer (required)"
  }
}
```

---

### browser_mouse_wheel
Scroll at specific coordinates using the mouse wheel.

```json
{
  "name": "browser_mouse_wheel",
  "parameters": {
    "x": "integer (required)",
    "y": "integer (required)",
    "deltaX": "integer (required) - Horizontal scroll (positive = right)",
    "deltaY": "integer (required) - Vertical scroll (positive = down)"
  }
}
```

---

## Tips

- Always call `browser_snapshot()` after navigation to see the page
- Element refs change after page updates - get a new snapshot
- For login-protected pages, inject cookies first
- Some sites may detect automation - use realistic delays
- Use `browser_console_messages(level="error")` to debug page issues
- Use `browser_network_requests()` to inspect API calls
- Vision tools (mouse_click, mouse_move, etc.) require `--caps=vision` flag
- PDF export requires `--caps=pdf` flag
