claude-browser-bridge 3.0.3 → 3.0.4
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 +60 -29
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -224,35 +224,66 @@ const HELP_TOOL = {
|
|
|
224
224
|
inputSchema: { type: "object", properties: {} },
|
|
225
225
|
};
|
|
226
226
|
|
|
227
|
-
const HELP_TEXT = `# Claude Browser Bridge —
|
|
228
|
-
|
|
229
|
-
##
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
227
|
+
const HELP_TEXT = `# Claude Browser Bridge — 58 Tools
|
|
228
|
+
|
|
229
|
+
## WHICH TOOL FIRST? (decision tree)
|
|
230
|
+
- Investigating a bug → diagnose (gives snapshot + errors + network + API responses in ONE call)
|
|
231
|
+
- Fixing CSS/visual → batch([screenshot, get_styles({selector:".target"}), get_html({selector:".target"})])
|
|
232
|
+
- Performance check → batch([performance_trace, get_load_timeline, heap_snapshot_summary])
|
|
233
|
+
- Accessibility audit → batch([get_accessibility_tree, check_contrast({selector:".text"})])
|
|
234
|
+
- Reading page content → eval (specific data) or get_page_text (all text)
|
|
235
|
+
- Interacting with page → diagnose first (get refs), then click/fill using refs
|
|
236
|
+
- Opening a URL for research → new_tab (NEVER navigate away from the app tab)
|
|
237
|
+
- Don't know → diagnose (covers 80% of needs)
|
|
238
|
+
|
|
239
|
+
## 10 CRITICAL RULES:
|
|
240
|
+
1. diagnose FIRST, always. ONE call replaces snapshot+get_console+get_network.
|
|
241
|
+
2. batch for parallel. 2+ independent calls → always batch. Every sequential call wastes 2-3 seconds.
|
|
242
|
+
3. select_tab once, never again. Pin target tab at start, stop passing tab_id.
|
|
243
|
+
4. new_tab for research. NEVER navigate the app tab to docs/Google.
|
|
244
|
+
5. screenshot after EVERY code edit. Never claim a fix works without seeing it.
|
|
245
|
+
6. inject_css before editing files. Test CSS live, confirm with screenshot, THEN write to file.
|
|
246
|
+
7. eval for state. React state, Redux store, variables — faster than parsing page text.
|
|
247
|
+
8. get_styles for CSS. Never guess computed values — read them.
|
|
248
|
+
9. 3 failed attempts = search web. new_tab + Google search. Stop guessing.
|
|
249
|
+
10. Use refs from diagnose/snapshot for click/fill. Never guess CSS selectors.
|
|
250
|
+
|
|
251
|
+
## KEY WORKFLOWS:
|
|
252
|
+
|
|
253
|
+
Visual/CSS Fix:
|
|
254
|
+
batch([screenshot, get_styles, get_html]) → inject_css({css:"..."}) → screenshot → if good, write to file
|
|
255
|
+
|
|
256
|
+
Bug Investigation:
|
|
257
|
+
diagnose → read errors → batch([get_grouped_console, get_network]) → fix → screenshot → verify
|
|
258
|
+
|
|
259
|
+
Performance Audit:
|
|
260
|
+
batch([performance_trace, get_load_timeline, heap_snapshot_summary])
|
|
261
|
+
|
|
262
|
+
Page Interaction:
|
|
263
|
+
diagnose → fill({ref:"ref_3", value:"..."}) → click({ref:"ref_0"}) → wait_for({text:"Success"})
|
|
264
|
+
|
|
265
|
+
Multi-tab Research:
|
|
266
|
+
select_tab(app) → new_tab(docs) → get_page_text → close_tab → continue on app
|
|
267
|
+
|
|
268
|
+
Error State Testing:
|
|
269
|
+
mock_network({url_pattern:"/api/cart", status_code:500}) → reload → screenshot
|
|
270
|
+
|
|
271
|
+
Regression Testing:
|
|
272
|
+
record_actions → reproduce → stop → fix → replay_actions → screenshot
|
|
273
|
+
|
|
274
|
+
Before/After Comparison:
|
|
275
|
+
screenshot (save dataUrl) → make changes → visual_diff({before_dataUrl:"..."})
|
|
276
|
+
|
|
277
|
+
## ALL 58 TOOLS BY CATEGORY:
|
|
278
|
+
Core: diagnose, batch, select_tab, snapshot, eval, screenshot, full_page_screenshot, get_page_text, get_html, get_page_info, browser_bridge_help
|
|
279
|
+
Interaction: click, fill, hover, scroll, press_key, select_option, upload_file, highlight_element
|
|
280
|
+
Navigation: navigate, new_tab, close_tab, go_back, go_forward, reload, list_tabs, wait_for
|
|
281
|
+
Debugging: get_console, get_grouped_console, get_network, search_network_bodies, get_styles, get_cookies, get_storage, get_clipboard, watch_dom_changes, generate_selector
|
|
282
|
+
Performance: performance_trace, heap_snapshot_summary, get_load_timeline
|
|
283
|
+
Accessibility: get_accessibility_tree, check_contrast
|
|
284
|
+
Emulation: emulate_device, network_throttle, set_geolocation, toggle_dark_mode
|
|
285
|
+
Testing: visual_diff, inject_css, mock_network, record_actions, replay_actions, handle_dialog
|
|
286
|
+
Productivity: save_form_profile, load_form_profile, save_tab_session, restore_tab_session, edit_cookie, export_pdf
|
|
256
287
|
`;
|
|
257
288
|
|
|
258
289
|
const BATCH_TOOL = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-browser-bridge",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.4",
|
|
4
4
|
"description": "Connect your live Chrome tabs to Claude Code — 57 tools for debugging, performance, accessibility, device emulation, and browser automation.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|