بنقرة واحدة
browserbridge
Real-time browser debugging and interaction via WebSocket bridge server on localhost:3141
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Real-time browser debugging and interaction via WebSocket bridge server on localhost:3141
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Protocol fuzzer script development using boofuzz framework. Use when creating network protocol fuzzers, defining protocol PDUs (Protocol Data Units), writing mutation-based fuzzing scripts, or contributing to the boofuzz project. Covers binary protocol definitions, session management, crash detection, and reporting findings.
Guide for creating Claude Code skill documents with YAML frontmatter, instructions, examples, and reference implementations
C# static analysis tool for call graphs, unused code detection, impact analysis, HTML documentation generation, and Graphviz diagram export
JavaScript/TypeScript static analysis tool for call graphs, unused code detection (tree shaking), dependency analysis, and circular dependency detection
UTF-8 JSON file I/O utilities to avoid Windows encoding issues (CP-1252 vs UTF-8)
Rust development patterns, project setup, CLI/TUI applications, error handling, and system integration
| name | BrowserBridge |
| description | Real-time browser debugging and interaction via WebSocket bridge server on localhost:3141 |
BrowserBridge enables Claude Code to interact with web browsers in real-time through a C# bridge server and Chrome/Edge extension for debugging, DOM inspection, and JavaScript execution.
Prerequisites Check:
curl http://localhost:3141/api/browser/health
If successful, you can execute browser commands. If connection refused, bridge server is not running.
Common Commands:
# Execute JavaScript
curl -X POST http://localhost:3141/api/browser/execute -H "Content-Type: application/json" -d '{"script": "document.title"}'
# Inspect element
curl -X POST http://localhost:3141/api/browser/inspect -H "Content-Type: application/json" -d '{"selector": "#myElement"}'
# List connections
curl http://localhost:3141/api/browser/connections
Bridge Server Running: User must have started the bridge server
cd bridge-server/ClaudeBrowserBridge
dotnet run
Extension Connected: User must have:
chrome://extensions/)Active Webpage: User must be viewing a webpage in the browser
curl http://localhost:3141/api/browser/health
Response:
{
"status": "healthy",
"timestamp": "2025-11-21T10:30:00Z",
"connections": 1
}
Use this to verify bridge server is running and count connected browsers.
curl http://localhost:3141/api/browser/connections
Response shows all connected browser tabs with connection IDs and last activity.
curl -X POST http://localhost:3141/api/browser/execute \
-H "Content-Type: application/json" \
-d '{"script": "YOUR_JAVASCRIPT_HERE"}'
Common Scripts:
Get page title:
curl -X POST http://localhost:3141/api/browser/execute -H "Content-Type: application/json" -d '{"script": "document.title"}'
Check if element exists:
curl -X POST http://localhost:3141/api/browser/execute -H "Content-Type: application/json" -d '{"script": "document.querySelector(\"#myId\") !== null"}'
Get element innerHTML:
curl -X POST http://localhost:3141/api/browser/execute -H "Content-Type: application/json" -d '{"script": "document.querySelector(\"#myId\")?.innerHTML"}'
Get element count:
curl -X POST http://localhost:3141/api/browser/execute -H "Content-Type: application/json" -d '{"script": "document.querySelectorAll(\".className\").length"}'
Check if function exists:
curl -X POST http://localhost:3141/api/browser/execute -H "Content-Type: application/json" -d '{"script": "typeof window.myFunction"}'
Get computed style:
curl -X POST http://localhost:3141/api/browser/execute -H "Content-Type: application/json" -d '{"script": "window.getComputedStyle(document.querySelector(\"#myId\")).display"}'
Test DOM change live:
curl -X POST http://localhost:3141/api/browser/execute -H "Content-Type: application/json" -d '{"script": "document.querySelector(\"#test\").style.border = \"2px solid red\""}'
Note: Results are sent via WebSocket. The bridge server writes script results to a file for easy access:
# Read the last script result
cat "C:/RI Services/BrowserBridge/claude_browser_last_result.json"
Example result:
{"type":"script_result","success":true,"result":"2408","timestamp":1764632896201}
For debugging, all messages are logged to:
powershell -Command "Get-Content 'C:\RI Services\BrowserBridge\all_messages.log' -Tail 20"
curl -X POST http://localhost:3141/api/browser/inspect \
-H "Content-Type: application/json" \
-d '{"selector": "#myElement"}'
Inspection results appear in bridge server console with:
outerHTML and innerHTML)Common Selectors:
#pagination.button-class[data-id="123"]#parent .child:first-of-typecurl -X POST http://localhost:3141/api/browser/screenshot \
-H "Content-Type: application/json" \
-d '{"fullPage": false}'
Screenshot sent as base64 PNG via WebSocket to bridge server logs.
curl http://localhost:3141/api/browser/connections/{connectionId}
Get detailed info about a specific connection.
curl "http://localhost:3141/api/browser/connections/{connectionId}/history?limit=50"
Get recent messages from a connection (console logs, errors, etc).
The extension automatically captures and sends to bridge server:
console.log, console.warn, console.error, console.infoCheck the bridge server console to see these events in real-time.
curl -X POST http://localhost:3141/api/browser/execute -H "Content-Type: application/json" -d '{"script": "document.querySelector(\"#myElement\") !== null"}'
curl -X POST http://localhost:3141/api/browser/inspect -H "Content-Type: application/json" -d '{"selector": "#myElement"}'
display: none or visibility: hidden)Check if function exists:
curl -X POST http://localhost:3141/api/browser/execute -H "Content-Type: application/json" -d '{"script": "typeof window.updatePaginationControls"}'
If returns "function", get its source:
curl -X POST http://localhost:3141/api/browser/execute -H "Content-Type: application/json" -d '{"script": "window.updatePaginationControls.toString()"}'
ES6 modules encapsulate their variables, making them inaccessible from the global scope. Instead of repeatedly exposing individual variables, add a generic getValue helper:
Add this pattern to the module:
// Debug helper - access module values by dot-notation path
window.getValue = (path) => {
const moduleVars = { state, filterOptions, myFunction, loadData }; // Add all you need
const parts = path.split('.');
let val = moduleVars[parts[0]];
for (let i = 1; i < parts.length && val !== undefined; i++) {
val = val[parts[i]];
}
return val;
};
Usage from Browser Bridge:
# Get nested state value
curl -X POST http://localhost:3141/api/browser/execute -H "Content-Type: application/json" -d '{"script": "getValue(\"state.filters.lang\")"}'
# Get array length
curl -X POST http://localhost:3141/api/browser/execute -H "Content-Type: application/json" -d '{"script": "getValue(\"filterOptions.refs\")?.length"}'
# Get complex state as JSON
curl -X POST http://localhost:3141/api/browser/execute -H "Content-Type: application/json" -d '{"script": "JSON.stringify({filters: getValue(\"state.filters\"), count: getValue(\"state.data.totalCount\")})"}'
Alternative: Expose state to window directly:
// At module start
const state = window.__state = { /* ... */ };
Then access via window.__state.filters.lang without needing getValue.
Before suggesting code changes, test them:
curl -X POST http://localhost:3141/api/browser/execute -H "Content-Type: application/json" -d '{"script": "document.querySelectorAll(\"button\").forEach(b => b.style.border = \"2px solid red\")"}'
User sees changes immediately. If it works, provide the permanent CSS/JS fix.
Always use optional chaining to avoid errors:
# Good
curl -X POST http://localhost:3141/api/browser/execute -H "Content-Type: application/json" -d '{"script": "document.querySelector(\"#myId\")?.innerHTML || \"Element not found\""}'
# Bad (will throw if element doesn't exist)
curl -X POST http://localhost:3141/api/browser/execute -H "Content-Type: application/json" -d '{"script": "document.querySelector(\"#myId\").innerHTML"}'
When calling functions programmatically that normally run from UI events, event may be undefined:
// BAD - throws "Cannot read properties of undefined (reading 'add')"
event?.target?.classList.add('active'); // classList is undefined when event is undefined
// GOOD - chain all the way through
event?.target?.classList?.add('active');
This applies to any pattern where you use ?. but then call a method on the result.
curl: (7) Failed to connect to localhost port 3141
Cause: Bridge server not running
Tell User:
The bridge server isn't running. Please start it:
cd bridge-server/ClaudeBrowserBridge
dotnet run
{"connections": 0}
Cause: Extension not connected
Tell User:
The extension isn't connected. Please:
1. Click the extension icon in your browser
2. Click "Connect to Claude"
3. Verify status shows "Connected" (green dot)
Results appear in bridge server console. Check logs for:
?.) or null checks\" for quotes inside JSON stringsWhen constructing curl commands with nested quotes:
# Escape double quotes inside JSON
curl -X POST http://localhost:3141/api/browser/execute -H "Content-Type: application/json" -d '{"script": "document.querySelector(\"#myId\")"}'
# Or use single quotes in JavaScript
curl -X POST http://localhost:3141/api/browser/execute -H "Content-Type: application/json" -d "{\"script\": \"document.querySelector('#myId')\"}"
Tell user to:
window.__claudeBridge exists in consoleResults are sent via WebSocket to bridge server console. User must check the terminal running dotnet run to see:
User says: "The pagination controls aren't showing up"
Claude:
curl http://localhost:3141/api/browser/health
curl -X POST http://localhost:3141/api/browser/execute -H "Content-Type: application/json" -d '{"script": "document.querySelector(\"#pagination\") !== null"}'
curl -X POST http://localhost:3141/api/browser/inspect -H "Content-Type: application/json" -d '{"selector": "#pagination"}'
Check bridge server logs → See it has display: none or empty innerHTML
Find why:
curl -X POST http://localhost:3141/api/browser/execute -H "Content-Type: application/json" -d '{"script": "typeof updatePaginationControls"}'
| Action | Endpoint | Method |
|---|---|---|
| Health check | /api/browser/health | GET |
| List connections | /api/browser/connections | GET |
| Execute JavaScript | /api/browser/execute | POST |
| Inspect element | /api/browser/inspect | POST |
| Screenshot | /api/browser/screenshot | POST |
| Connection details | /api/browser/connections/{id} | GET |
| Message history | /api/browser/connections/{id}/history | GET |
bridge-server/ClaudeBrowserBridge/extension/SETUP.md