Chuyển đến nội dung
Skillpedia
Kiểm thử11k · #11797

browser-edge-cases

Skill này làm gì

Skill này cung cấp cho AI một phương pháp từng bước để tìm hiểu vì sao một tác vụ trình duyệt bị lỗi trên các website phức tạp. Skill dành cho người xây dựng hoặc vận hành các tác vụ trình duyệt tự động.

Khi nào nên dùng

  • ✓Khi thao tác cuộn hoặc nhấp trên một website có vẻ thành công nhưng không có gì xảy ra.
  • ✓Khi văn bản đã gõ bị biến mất hoặc trang luôn hiển thị nội dung cũ.
  • ✓Khi một bước trình duyệt tải sai trang trên một website có nhiều script nặng.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/aden-hive/hive/blob/main/.claude/skills/browser-edge-cases/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Bot trình duyệt của tôi nhấp nút trên LinkedIn nhưng không có gì xảy ra. Tôi muốn tìm ra nguyên nhân và sửa nó.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

AI trước tiên kiểm tra trình duyệt trên một trang đơn giản, sau đó xem console và cấu trúc trang trên trang khó. AI so sánh các kết quả để tìm nguyên nhân rồi điều chỉnh các bước.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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:

# 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

console = await browser_console(tab_id)
# Look for: CSP violations, React errors, JavaScript exceptions

Step 2b: Inspect DOM structure

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

Symptom Likely Cause Check
Scroll doesn't move Nested scroll container Look for overflow: scroll divs
Click no effect Element covered Check getBoundingClientRect vs viewport
Type clears Autocomplete/React Check for event listeners on input; try a type action with no selector
Snapshot hangs Huge DOM Check node count in snapshot
Snapshot stale SPA hydration Wait after navigation

Phase 3: Implement Multi-Layer Fix

Pattern: Always have fallbacks

async def robust_operation(tab_id):
    # Method 1: Primary approach
    try:
        result = await primary_method(tab_id)
        if verify_success(result):
            return result
    except Exception:
        pass

    # Method 2: CDP fallback
    try:
        result = await cdp_fallback(tab_id)
        if verify_success(result):
            return result
    except Exception:
        pass

    # Method 3: JavaScript fallback
    return await javascript_fallback(tab_id)

Pattern: Always add timeouts

# Bad - can hang forever
result = await browser_snapshot(tab_id)

# Good - fails fast with useful error
try:
    result = await browser_snapshot(tab_id, timeout_s=10.0)
except asyncio.TimeoutError:
    # Handle timeout gracefully
    result = await fallback_snapshot(tab_id)

Phase 4: Verify Fix

1. Run against problematic site → should work
2. Run against simple site → should still work (regression check)
3. Document in registry.md

Pattern Library

P1: Nested Scrollable Containers

Sites: LinkedIn, Twitter/X, any SPA with scrollable feeds

Detection:

// Find largest scrollable container
const candidates = [];
document.querySelectorAll('*').forEach(el => {
    const style = getComputedStyle(el);
    if (style.overflow.includes('scroll') || style.overflow.includes('auto')) {
        const rect = el.getBoundingClientRect();
        if (rect.width > 100 && rect.height > 100) {
            candidates.push({el, area: rect.width * rect.height});
        }
    }
});
candidates.sort((a, b) => b.area - a.area);
return candidates[0]?.el;

Fix: Dispatch scroll events at container's center, not viewport center.

P2: Element Covered by Overlay

Sites: Modals, tooltips, SPAs with loading overlays

Detection:

const rect = element.getBoundingClientRect();
const centerX = rect.left + rect.width / 2;
const centerY = rect.top + rect.height / 2;
const topElement = document.elementFromPoint(centerX, centerY);
return topElement === element || element.contains(topElement);

Fix: Wait for overlay to disappear, or use JavaScript click.

P3: React Synthetic Events

Sites: React SPAs, modern

Câu hỏi thường gặp

Skill có hoạt động trên mọi website không?

Skill được viết cho các trang phức tạp như LinkedIn, X và ứng dụng một trang có những phần trang bị ẩn.

AI bắt đầu từ đâu?

AI bắt đầu bằng việc tái hiện lỗi với một bài kiểm tra tối giản trước khi thay đổi bất cứ thứ gì.

Skill dùng những công cụ trình duyệt nào?

Skill dùng các công cụ như điều hướng, chụp snapshot, tương tác và kiểm tra console.

Chi tiết

Mô tả gốc của tác giả

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.

repo: aden-hive/hive

Độ phổ biến

Sao GitHub
11k
Vị trí xếp hạng
#11797
Giấy phép
Apache-2.0
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự