debugging-firefox
Use when user wants to debug web pages, inspect network requests, monitor console logs, or interact with web applications using Firefox DevTools
When & Why to Use This Skill
This Claude skill enables advanced web debugging and automation using Firefox DevTools. It allows developers to inspect network traffic, monitor JavaScript console logs, interact with DOM elements via snapshots, and manage browser tabs directly within the AI interface, streamlining the troubleshooting process for web applications and improving front-end development efficiency.
Use Cases
- Diagnosing failed API requests and CORS issues by inspecting detailed network request headers, status codes, and response data.
- Identifying and fixing JavaScript errors or warnings by monitoring real-time console logs during specific user interactions.
- Debugging UI/UX issues and element interactions by taking page snapshots and simulating user actions like clicks, hovers, and form submissions.
- Investigating web performance bottlenecks by analyzing network request durations and filtering for slow-loading assets.
- Testing multi-page workflows and tab management by programmatically opening, switching, and closing browser tabs.
| name | debugging-firefox |
|---|---|
| description | Use when user wants to debug web pages, inspect network requests, monitor console logs, or interact with web applications using Firefox DevTools |
Debugging with Firefox DevTools
Debug web applications using Firefox DevTools MCP tools. Use this skill for web debugging, network inspection, console monitoring, and page interaction.
Core Workflows
1. Network Debugging
When to use: Investigate failed requests, slow loading, API issues, or CORS problems.
Pattern:
1. list_network_requests - Get overview (use filters: sinceMs, urlContains, status)
2. get_network_request - Deep dive on specific request using ID
3. Look for: status codes, timing, headers, response data
Key filters:
sinceMs: Recent requests only (e.g., 5000 for last 5 seconds)urlContains: Filter by URL substringstatus,statusMin,statusMax: Filter by HTTP statusmethod: GET, POST, etc.isXHR: true for fetch/XHR requests only
Example:
list_network_requests(sinceMs=10000, status=404, limit=20)
get_network_request(id="47-abc123...")
2. Console Monitoring
When to use: Debug JavaScript errors, warnings, or logs.
Pattern:
1. clear_console_messages - Clear old messages (optional but recommended)
2. Trigger the behavior (navigate, click, etc.)
3. list_console_messages - Check for errors/warnings
Key filters:
level: debug, info, warn, errorsinceMs: Recent messages onlytextContains: Filter by contentsource: console-api, javascript, network
Example:
clear_console_messages()
# ... trigger behavior ...
list_console_messages(level="error", sinceMs=5000)
3. Page Inspection & Interaction
When to use: Understand page structure or interact with elements.
Critical rule: ALWAYS take a fresh snapshot after navigation. UIDs become stale.
Pattern:
1. take_snapshot - Get page structure with UIDs
2. Use UIDs for interaction:
- click_by_uid
- fill_by_uid
- hover_by_uid
- screenshot_by_uid
3. After navigation/DOM changes - take_snapshot again!
Snapshot parameters:
maxLines: Control output size (default 100)includeText: Show element text (default true)includeAttributes: Detailed ARIA/attributes (default false)maxDepth: Tree depth limit
Example:
take_snapshot(maxLines=50)
click_by_uid("2_10")
take_snapshot() # Fresh snapshot after click!
4. Tab Management
When to use: Test multiple pages or compare behavior.
Pattern:
1. list_pages - See all open tabs
2. select_page(pageIdx=1) - Switch tabs by index
3. new_page(url="...") - Open new tab
4. close_page(pageIdx=2) - Close tab
Example:
list_pages()
new_page("https://example.com")
select_page(pageIdx=1)
Common Debugging Scenarios
Scenario: "Page loads but API call fails"
list_network_requests(isXHR=true, statusMin=400)- Find failed API callsget_network_request(id="...")- Check request/response details- Look for: wrong URL, CORS headers, 401/403 auth issues
Scenario: "Button click doesn't work"
take_snapshot()- Get page structureclick_by_uid("...")- Click the buttonlist_console_messages(level="error")- Check for JS errorslist_network_requests(sinceMs=2000)- Check for triggered requests
Scenario: "Form submission issues"
take_snapshot()- Get form structurefill_form_by_uid(elements=[{uid: "...", value: "..."}])- Fill multiple fieldsclick_by_uid("submit_button_uid")- Submitlist_console_messages()+list_network_requests(method="POST")- Debug
Scenario: "Performance investigation"
clear_console_messages()+ clear before measurement- Navigate or trigger action
list_network_requests(sortBy="duration", limit=20)- Find slow requestsget_network_request(id="...")- Check timing details
Best Practices
Clear before measuring: Use
clear_console_messages()before testing to focus on new messagesUse filters aggressively: Don't list all requests - filter by time, status, or URL
Always snapshot after navigation: UIDs become stale after DOM changes
Start broad, then narrow:
- First:
list_network_requests()overview - Then:
get_network_request(id)for details
- First:
Check both console and network: Errors can appear in either place
Use screenshots sparingly: Snapshots are more useful for structure and interaction
Leverage sinceMs: Focus on recent activity (e.g.,
sinceMs=5000for last 5 seconds)
Additional Resources
- Complete Tool Reference: @tools-reference.md
- Practical Examples: @examples.md - Real-world debugging scenarios
- Troubleshooting Guide: @troubleshooting.md - Common issues and solutions
Tips & Tricks
- Stale UID error? → Take a fresh snapshot
- Too much network noise? → Use
sinceMsorurlContainsfilters - Need to test dialogs? → Use
accept_dialog()ordismiss_dialog() - Need specific viewport? → Use
set_viewport_size(width, height) - Multiple pages open? → Use
list_pages()andselect_page() - Console shows [Object object]? → Use
JSON.stringify()when logging objects (see @troubleshooting.md)