chromeflow 0.1.25 → 0.1.27
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/CLAUDE.md +5 -3
- package/dist/tools/browser.js +5 -5
- package/package.json +1 -1
package/CLAUDE.md
CHANGED
|
@@ -63,7 +63,8 @@ Do NOT ask "should I open the browser?" — just do it. The user expects seamles
|
|
|
63
63
|
[if fails] get_elements() — get EXACT DOM coords, use these in highlight_region
|
|
64
64
|
highlight_region(x,y,w,h,msg) — use exact coords from get_elements, not estimates
|
|
65
65
|
[after wait_for_click] get_page_text() — confirm result, NOT take_screenshot
|
|
66
|
-
[last resort only] take_screenshot() —
|
|
66
|
+
[last resort only] take_screenshot() — returns image to Claude only (no file, no clipboard)
|
|
67
|
+
take_and_copy_screenshot() — same as above BUT also saves PNG + copies to clipboard
|
|
67
68
|
d. Pause for the user when needed:
|
|
68
69
|
find_and_highlight(text, msg) — show the user what to do
|
|
69
70
|
wait_for_click() — wait for user interaction
|
|
@@ -108,9 +109,10 @@ Use the absolute path for `envPath` — it's the Claude Code working directory +
|
|
|
108
109
|
- For multi-session tasks (long forms that may exceed context), call `save_page_state()` as a checkpoint. A future session can call `restore_page_state()` to reload all field values from the saved snapshot.
|
|
109
110
|
|
|
110
111
|
## Working with multiple tabs
|
|
111
|
-
- `
|
|
112
|
-
- `
|
|
112
|
+
- Before opening a new tab, call `list_tabs()` to check if the target URL is already open — use `switch_to_tab` to return to it instead of opening a duplicate.
|
|
113
|
+
- `open_page(url, new_tab=true)` opens a URL without losing the current tab. Use sparingly — prefer switching to an existing tab over opening a new one.
|
|
113
114
|
- `switch_to_tab("1")` switches by tab number; `switch_to_tab("form")` matches by URL or title substring.
|
|
115
|
+
- `list_tabs()` shows all open tabs with their index, title, and URL.
|
|
114
116
|
|
|
115
117
|
## Error handling
|
|
116
118
|
- After any action → `get_page_text()` to check for errors (not `take_screenshot`)
|
package/dist/tools/browser.js
CHANGED
|
@@ -50,7 +50,7 @@ ${lines.join("\n")}` }]
|
|
|
50
50
|
);
|
|
51
51
|
server.tool(
|
|
52
52
|
"take_screenshot",
|
|
53
|
-
"Capture a screenshot
|
|
53
|
+
"Capture a screenshot and return it to Claude only \u2014 no file is saved, nothing goes to the clipboard. Use ONLY when you need to visually inspect the page layout or get pixel coordinates for highlight_region. DO NOT use to check page state or confirm actions \u2014 use get_page_text for that. To also save or copy the image, use take_and_copy_screenshot instead.",
|
|
54
54
|
{},
|
|
55
55
|
async () => {
|
|
56
56
|
const response = await bridge.request({ type: "screenshot" });
|
|
@@ -74,10 +74,10 @@ ${lines.join("\n")}` }]
|
|
|
74
74
|
);
|
|
75
75
|
server.tool(
|
|
76
76
|
"take_and_copy_screenshot",
|
|
77
|
-
`Take a screenshot, copy it to the system clipboard, and save it as a PNG file.
|
|
78
|
-
Use this when you need to
|
|
79
|
-
|
|
80
|
-
save_to controls where the
|
|
77
|
+
`Take a screenshot, return it to Claude, copy it to the system clipboard, and save it as a PNG file.
|
|
78
|
+
Use this instead of take_screenshot when you need the image outside of Claude \u2014 to paste into a chat, upload to a form, or keep as a file.
|
|
79
|
+
Unlike take_screenshot (Claude-only), this also puts the image on the clipboard and saves it to disk.
|
|
80
|
+
save_to controls where the PNG is saved: "downloads" (default) saves to ~/Downloads, "cwd" saves to Claude's current working directory.`,
|
|
81
81
|
{
|
|
82
82
|
save_to: z.enum(["downloads", "cwd"]).optional().describe(`Where to save the PNG file: "downloads" (~/Downloads, default) or "cwd" (Claude's current working directory)`)
|
|
83
83
|
},
|
package/package.json
CHANGED