claude-browser-bridge 4.1.0 → 5.0.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.
- package/index.js +58 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -317,8 +317,15 @@ Cross-Product Comparison:
|
|
|
317
317
|
State Management Testing:
|
|
318
318
|
set_storage({key:"cache", action:"remove"}) → reload → verify fresh state
|
|
319
319
|
|
|
320
|
-
##
|
|
321
|
-
|
|
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
|
|
322
329
|
Interaction: click, fill, hover, scroll, press_key, select_option, upload_file, highlight_element
|
|
323
330
|
Navigation: navigate, new_tab, close_tab, go_back, go_forward, reload, list_tabs, wait_for
|
|
324
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
|
|
@@ -329,6 +336,8 @@ Testing: visual_diff, inject_css, mock_network, record_actions, replay_actions,
|
|
|
329
336
|
Productivity: save_form_profile, load_form_profile, save_tab_session, restore_tab_session, edit_cookie, export_pdf
|
|
330
337
|
Visual Debugging: inspect_pixel, get_element_rect, compare_tabs, annotate, clear_annotations, capture_canvas
|
|
331
338
|
Storage: set_storage
|
|
339
|
+
Visual Debugging: inspect_pixel, get_element_rect, compare_tabs, annotate, clear_annotations, capture_canvas
|
|
340
|
+
Storage: set_storage
|
|
332
341
|
`;
|
|
333
342
|
|
|
334
343
|
const BATCH_TOOL = {
|
|
@@ -1014,10 +1023,45 @@ const TOOLS = [
|
|
|
1014
1023
|
},
|
|
1015
1024
|
},
|
|
1016
1025
|
},
|
|
1026
|
+
// =================== VIDEO UNDERSTANDING TOOLS ===================
|
|
1027
|
+
{
|
|
1028
|
+
name: "video_get_captions",
|
|
1029
|
+
description: "Extract ALL captions/subtitles from the current YouTube video in one call — returns every line with start/end timestamps. Faster than watching the video. Use on any YouTube tab to get what the instructor is saying.",
|
|
1030
|
+
inputSchema: { type: "object", properties: { ...TAB_ID } },
|
|
1031
|
+
},
|
|
1032
|
+
{
|
|
1033
|
+
name: "video_control",
|
|
1034
|
+
description: "Control video playback: play, pause, seek to a timestamp, change speed, or get current status. Use action='seek' with value=seconds to jump to a specific point. action='speed' with value=2 for 2x playback.",
|
|
1035
|
+
inputSchema: {
|
|
1036
|
+
type: "object",
|
|
1037
|
+
properties: {
|
|
1038
|
+
action: { type: "string", enum: ["play", "pause", "seek", "status", "speed"], description: "What to do with the video" },
|
|
1039
|
+
value: { type: "number", description: "Seek target in seconds, or playback speed multiplier" },
|
|
1040
|
+
...TAB_ID,
|
|
1041
|
+
},
|
|
1042
|
+
required: ["action"],
|
|
1043
|
+
},
|
|
1044
|
+
},
|
|
1045
|
+
{
|
|
1046
|
+
name: "video_capture_frame",
|
|
1047
|
+
description: "Pause the video at a specific timestamp and screenshot what's on screen — lets Claude 'see' code, slides, diagrams shown in the video. Also returns the caption at that moment. Pass timestamp in seconds.",
|
|
1048
|
+
inputSchema: {
|
|
1049
|
+
type: "object",
|
|
1050
|
+
properties: {
|
|
1051
|
+
timestamp: { type: "number", description: "Time in seconds to capture the frame at (e.g. 120 for 2:00)" },
|
|
1052
|
+
...TAB_ID,
|
|
1053
|
+
},
|
|
1054
|
+
},
|
|
1055
|
+
},
|
|
1056
|
+
{
|
|
1057
|
+
name: "video_get_chapters",
|
|
1058
|
+
description: "Extract chapter markers from a YouTube video (from the description or progress bar). Returns chapter titles with timestamps — use to navigate a tutorial by topic.",
|
|
1059
|
+
inputSchema: { type: "object", properties: { ...TAB_ID } },
|
|
1060
|
+
},
|
|
1017
1061
|
];
|
|
1018
1062
|
|
|
1019
1063
|
const server = new Server(
|
|
1020
|
-
{ name: "browser-bridge", version: "
|
|
1064
|
+
{ name: "browser-bridge", version: "5.0.0" },
|
|
1021
1065
|
{ capabilities: { tools: {} } }
|
|
1022
1066
|
);
|
|
1023
1067
|
|
|
@@ -1062,6 +1106,17 @@ function formatResult(name, result) {
|
|
|
1062
1106
|
],
|
|
1063
1107
|
};
|
|
1064
1108
|
}
|
|
1109
|
+
// Video frame capture: return the screenshot as an image
|
|
1110
|
+
if (name === "video_capture_frame" && result?.dataUrl) {
|
|
1111
|
+
const base64 = result.dataUrl.replace(/^data:image\/png;base64,/, "");
|
|
1112
|
+
const { dataUrl, ...rest } = result;
|
|
1113
|
+
return {
|
|
1114
|
+
content: [
|
|
1115
|
+
{ type: "image", data: base64, mimeType: "image/png" },
|
|
1116
|
+
{ type: "text", text: JSON.stringify(rest, null, 2) },
|
|
1117
|
+
],
|
|
1118
|
+
};
|
|
1119
|
+
}
|
|
1065
1120
|
// Observe mode: if the response includes an auto-captured screenshot, return it as an image
|
|
1066
1121
|
if (result?.__screenshot) {
|
|
1067
1122
|
const base64 = result.__screenshot.replace(/^data:image\/png;base64,/, "");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-browser-bridge",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.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": {
|