# Browser Edge Cases

Debugs browser automation failures on complex sites like SPAs and Shadow DOM pages.

- Repository: https://github.com/aden-hive/hive (11131 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-10-26
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add aden-hive/hive --skill browser-edge-cases -g -a claude-code -y`
Codex: `npx skills add aden-hive/hive --skill browser-edge-cases -g -a codex -y`
Cursor: `npx skills add aden-hive/hive --skill browser-edge-cases -g -a cursor -y`
Gemini CLI: `npx skills add aden-hive/hive --skill browser-edge-cases -g -a gemini-cli -y`

## Description

SOP for debugging browser automation failures on complex websites. Use when browser tools fail on specific sites like LinkedIn, Twitter/X, SPAs, or sites with Shadow DOM.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Browser Tool Edge Cases

Standard Operating Procedure for debugging and fixing browser automation failures on complex websites.

## When to Use This Skill

- `browser_interact(action="scroll")` succeeds but page doesn't move
- `browser_interact(action="left_click")` succeeds but no action triggered
- `browser_interact(action="type")` text disappears or doesn't work
- `browser_snapshot` hangs or returns stale content
- `browser_navigate` loads wrong content

## SOP: Debugging Browser Tool Failures

### Phase 1: Reproduce & Isolate

```
1. Create minimal test case demonstrating failure
2. Test against simple site (example.com) to verify tool works
3. Test against problematic site to confirm issue
```

**Quick isolation test:**
```python
# Test 1: Does the tool work at all?
await browser_navigate(tab_id, "https://example.com")
result = await browser_interact(action="scroll", tab_id=tab_id, scroll_direction="down", scroll_amount=100)
# Should work on simple sites

# Test 2: Does it fail on the problematic site?
await browser_navigate(tab_id, "https://linkedin.com/feed")
result = await browser_interact(action="scroll", tab_id=tab_id, scroll_direction="down", scroll_amount=100)
# If this fails but example.com works → site-specific edge case
```

### Phase 2: Analyze Root Cause

**Step 2a: Check console for errors**
```python
console = await browser_console(tab_id)
# Look for: CSP violations, React errors, JavaScript exceptions
```

**Step 2b: Inspect DOM structure**
```python
html = await browser_html(tab_id)
snapshot = await browser_snapshot(tab_id)
# Look for:
# - Nested scrollable divs (overflow: scroll/auto)
# - Shadow DOM roots
# - iframes
# - Custom widgets
```

**Step 2c: Identify the pattern**

The rest: https://github.com/aden-hive/hive/blob/HEAD/.claude/skills/browser-edge-cases/SKILL.md
