claude-browser-bridge 4.0.4 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +39 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -289,8 +289,9 @@ Bug Investigation:
|
|
|
289
289
|
Performance Audit:
|
|
290
290
|
batch([performance_trace, get_load_timeline, heap_snapshot_summary])
|
|
291
291
|
|
|
292
|
-
Page Interaction:
|
|
293
|
-
diagnose → fill({ref:"ref_3"
|
|
292
|
+
Page Interaction (with observe mode — Claude sees every action's result automatically):
|
|
293
|
+
observe_mode({enabled:true}) → diagnose → fill({ref:"ref_3"}) → click({ref:"ref_0"})
|
|
294
|
+
Every interaction returns a screenshot — no separate screenshot calls needed.
|
|
294
295
|
|
|
295
296
|
Multi-tab Research:
|
|
296
297
|
select_tab(app) → new_tab(docs) → get_page_text → close_tab → continue on app
|
|
@@ -316,8 +317,15 @@ Cross-Product Comparison:
|
|
|
316
317
|
State Management Testing:
|
|
317
318
|
set_storage({key:"cache", action:"remove"}) → reload → verify fresh state
|
|
318
319
|
|
|
319
|
-
##
|
|
320
|
-
|
|
320
|
+
## COMMON BUG PATTERNS (check these before investigating):
|
|
321
|
+
- Stale session: clear with eval({code:"sessionStorage.clear();['session','cache','config'].forEach(p=>{for(let i=localStorage.length-1;i>=0;i--){const k=localStorage.key(i);if(k.includes(p))localStorage.removeItem(k)}})"}) + reload
|
|
322
|
+
- React state unreadable (prod): don't rely on class names. Use get_styles, get_element_rect, eval with data-testid or global store
|
|
323
|
+
- Login expired: get_network shows empty/{} responses → re-authenticate with the platform CLI
|
|
324
|
+
- Visual change not visible: wait 3s for HMR, use inject_css to test live, get_styles to verify computed value
|
|
325
|
+
- Font/asset mismatch: get_grouped_console → look for repeated warnings with API vs resolved values
|
|
326
|
+
|
|
327
|
+
## ALL 66 TOOLS BY CATEGORY:
|
|
328
|
+
Core: diagnose, batch, select_tab, snapshot, eval, screenshot, full_page_screenshot, get_page_text, get_html, get_page_info, browser_bridge_help, observe_mode
|
|
321
329
|
Interaction: click, fill, hover, scroll, press_key, select_option, upload_file, highlight_element
|
|
322
330
|
Navigation: navigate, new_tab, close_tab, go_back, go_forward, reload, list_tabs, wait_for
|
|
323
331
|
Debugging: get_console, get_grouped_console, get_network, search_network_bodies, get_styles, get_cookies, get_storage, get_clipboard, watch_dom_changes, generate_selector
|
|
@@ -328,6 +336,8 @@ Testing: visual_diff, inject_css, mock_network, record_actions, replay_actions,
|
|
|
328
336
|
Productivity: save_form_profile, load_form_profile, save_tab_session, restore_tab_session, edit_cookie, export_pdf
|
|
329
337
|
Visual Debugging: inspect_pixel, get_element_rect, compare_tabs, annotate, clear_annotations, capture_canvas
|
|
330
338
|
Storage: set_storage
|
|
339
|
+
Visual Debugging: inspect_pixel, get_element_rect, compare_tabs, annotate, clear_annotations, capture_canvas
|
|
340
|
+
Storage: set_storage
|
|
331
341
|
`;
|
|
332
342
|
|
|
333
343
|
const BATCH_TOOL = {
|
|
@@ -354,6 +364,19 @@ const BATCH_TOOL = {
|
|
|
354
364
|
},
|
|
355
365
|
};
|
|
356
366
|
|
|
367
|
+
const OBSERVE_TOOL = {
|
|
368
|
+
name: "observe_mode",
|
|
369
|
+
description:
|
|
370
|
+
"Toggle observe mode ON/OFF. When ON, every interaction tool (click, fill, hover, scroll, navigate) automatically captures and returns a screenshot in its response — Claude sees the visual result of every action without separate screenshot calls. Turn ON at session start for visual debugging workflows. Turn OFF for speed when you don't need visual feedback.",
|
|
371
|
+
inputSchema: {
|
|
372
|
+
type: "object",
|
|
373
|
+
properties: {
|
|
374
|
+
enabled: { type: "boolean", description: "true to enable, false to disable" },
|
|
375
|
+
},
|
|
376
|
+
required: ["enabled"],
|
|
377
|
+
},
|
|
378
|
+
};
|
|
379
|
+
|
|
357
380
|
const TAB_ID = {
|
|
358
381
|
tab_id: {
|
|
359
382
|
type: "number",
|
|
@@ -1007,7 +1030,7 @@ const server = new Server(
|
|
|
1007
1030
|
{ capabilities: { tools: {} } }
|
|
1008
1031
|
);
|
|
1009
1032
|
|
|
1010
|
-
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [HELP_TOOL, BATCH_TOOL, ...TOOLS] }));
|
|
1033
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [HELP_TOOL, OBSERVE_TOOL, BATCH_TOOL, ...TOOLS] }));
|
|
1011
1034
|
|
|
1012
1035
|
function formatResult(name, result) {
|
|
1013
1036
|
if ((name === "screenshot" || name === "full_page_screenshot") && result?.dataUrl) {
|
|
@@ -1048,6 +1071,17 @@ function formatResult(name, result) {
|
|
|
1048
1071
|
],
|
|
1049
1072
|
};
|
|
1050
1073
|
}
|
|
1074
|
+
// Observe mode: if the response includes an auto-captured screenshot, return it as an image
|
|
1075
|
+
if (result?.__screenshot) {
|
|
1076
|
+
const base64 = result.__screenshot.replace(/^data:image\/png;base64,/, "");
|
|
1077
|
+
const { __screenshot, ...rest } = result;
|
|
1078
|
+
return {
|
|
1079
|
+
content: [
|
|
1080
|
+
{ type: "text", text: JSON.stringify(rest, null, 2) },
|
|
1081
|
+
{ type: "image", data: base64, mimeType: "image/png" },
|
|
1082
|
+
],
|
|
1083
|
+
};
|
|
1084
|
+
}
|
|
1051
1085
|
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
1052
1086
|
}
|
|
1053
1087
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-browser-bridge",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.1",
|
|
4
4
|
"description": "Connect your live Chrome tabs to Claude Code — 65 tools for debugging, performance, accessibility, visual inspection, and browser automation.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|