claude-browser-bridge 4.0.4 → 4.1.0

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.
Files changed (2) hide show
  1. package/index.js +28 -3
  2. 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", value:"..."}) → click({ref:"ref_0"}) → wait_for({text:"Success"})
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
@@ -354,6 +355,19 @@ const BATCH_TOOL = {
354
355
  },
355
356
  };
356
357
 
358
+ const OBSERVE_TOOL = {
359
+ name: "observe_mode",
360
+ description:
361
+ "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.",
362
+ inputSchema: {
363
+ type: "object",
364
+ properties: {
365
+ enabled: { type: "boolean", description: "true to enable, false to disable" },
366
+ },
367
+ required: ["enabled"],
368
+ },
369
+ };
370
+
357
371
  const TAB_ID = {
358
372
  tab_id: {
359
373
  type: "number",
@@ -1007,7 +1021,7 @@ const server = new Server(
1007
1021
  { capabilities: { tools: {} } }
1008
1022
  );
1009
1023
 
1010
- server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [HELP_TOOL, BATCH_TOOL, ...TOOLS] }));
1024
+ server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [HELP_TOOL, OBSERVE_TOOL, BATCH_TOOL, ...TOOLS] }));
1011
1025
 
1012
1026
  function formatResult(name, result) {
1013
1027
  if ((name === "screenshot" || name === "full_page_screenshot") && result?.dataUrl) {
@@ -1048,6 +1062,17 @@ function formatResult(name, result) {
1048
1062
  ],
1049
1063
  };
1050
1064
  }
1065
+ // Observe mode: if the response includes an auto-captured screenshot, return it as an image
1066
+ if (result?.__screenshot) {
1067
+ const base64 = result.__screenshot.replace(/^data:image\/png;base64,/, "");
1068
+ const { __screenshot, ...rest } = result;
1069
+ return {
1070
+ content: [
1071
+ { type: "text", text: JSON.stringify(rest, null, 2) },
1072
+ { type: "image", data: base64, mimeType: "image/png" },
1073
+ ],
1074
+ };
1075
+ }
1051
1076
  return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
1052
1077
  }
1053
1078
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-browser-bridge",
3
- "version": "4.0.4",
3
+ "version": "4.1.0",
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": {