pi-chrome 0.11.3 → 0.11.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/README.md
CHANGED
|
@@ -69,7 +69,7 @@ pi-chrome v<version>
|
|
|
69
69
|
|
|
70
70
|
By default, `chrome_*` clicks and keystrokes are **synthetic** DOM events (`event.isTrusted === false`). They drive React/Vue/Angular state correctly but **do not** satisfy Chrome's user-activation gates: clipboard write, fullscreen, file picker, and autoplay all need a real user gesture.
|
|
71
71
|
|
|
72
|
-
pi-chrome can optionally route input through `chrome.debugger` (CDP `Input.dispatchMouseEvent` / `Input.dispatchKeyEvent`) so each event arrives as `isTrusted=true`, satisfies user-activation, and bypasses site bot-detection that filters synthetic events. The tradeoff: Chrome pins a
|
|
72
|
+
pi-chrome can optionally route input through `chrome.debugger` (CDP `Input.dispatchMouseEvent` / `Input.dispatchKeyEvent`) so each event arrives as `isTrusted=true`, satisfies user-activation, and bypasses site bot-detection that filters synthetic events. The tradeoff: Chrome pins a *"Pi Chrome Connector started debugging this browser"* banner to the top of any debugged tab.
|
|
73
73
|
|
|
74
74
|
Usage:
|
|
75
75
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest_version": 3,
|
|
3
3
|
"name": "Pi Chrome Connector",
|
|
4
|
-
"version": "0.11.
|
|
4
|
+
"version": "0.11.4",
|
|
5
5
|
"description": "Lets Pi control tabs in Chrome via a local connector at 127.0.0.1.",
|
|
6
6
|
"permissions": ["tabs", "scripting", "storage", "activeTab", "alarms", "webNavigation", "debugger"],
|
|
7
7
|
"host_permissions": ["<all_urls>", "http://127.0.0.1:17318/*"],
|
|
@@ -518,13 +518,13 @@ Usage rules:
|
|
|
518
518
|
permissionGranted?: boolean;
|
|
519
519
|
};
|
|
520
520
|
if (status.permissionGranted) {
|
|
521
|
-
const banner = status.attachedTabs && status.attachedTabs.length ? ` (
|
|
521
|
+
const banner = status.attachedTabs && status.attachedTabs.length ? ` (‘Pi Chrome Connector started debugging this browser’ banner up on ${status.attachedTabs.length} tab(s))` : "";
|
|
522
522
|
const note =
|
|
523
523
|
status.mode === "auto"
|
|
524
|
-
? " Clicks/keys are quiet by default; if a site rejects a quiet click, pi-chrome retries it once with a real-looking click.
|
|
524
|
+
? " Clicks/keys are quiet by default; if a site rejects a quiet click, pi-chrome retries it once with a real-looking click. The Chrome banner shows only when that retry happens."
|
|
525
525
|
: status.mode === "on"
|
|
526
|
-
? " Every click and keystroke uses a real-looking event.
|
|
527
|
-
: " All clicks are quiet, no
|
|
526
|
+
? " Every click and keystroke uses a real-looking event. The Chrome banner stays up on every tab pi-chrome touches."
|
|
527
|
+
: " All clicks are quiet, no banner. Some sites (sign-ins, copy buttons, file pickers, paywalls) may silently ignore them. Switch to /chrome-trusted auto if a site isn’t responding.";
|
|
528
528
|
const label = status.mode === "auto" ? "auto (smart upgrade)" : status.mode === "on" ? "on (always real-looking)" : "off (always quiet)";
|
|
529
529
|
lines.push(`✓ Click mode: ${label}${banner}.${note}`);
|
|
530
530
|
} else {
|
|
@@ -541,7 +541,7 @@ Usage rules:
|
|
|
541
541
|
|
|
542
542
|
pi.registerCommand("chrome-trusted", {
|
|
543
543
|
description:
|
|
544
|
-
"Choose how realistically pi-chrome should drive Chrome. Real-looking clicks/keys unlock things like copy-to-clipboard buttons, file pickers, and sign-in pages, but show a
|
|
544
|
+
"Choose how realistically pi-chrome should drive Chrome. Real-looking clicks/keys unlock things like copy-to-clipboard buttons, file pickers, and sign-in pages, but show a banner at the top of every Chrome window saying it's being driven by pi-chrome. Three modes:\n auto (default) — quiet by default; auto-upgrade when a site blocks the quiet click.\n off — always quiet, no banner; some sites won't accept these clicks.\n on — always real-looking, banner stays up the whole session.\n status — show the current mode.",
|
|
545
545
|
getArgumentCompletions: (prefix) => {
|
|
546
546
|
const items = [
|
|
547
547
|
{ value: "auto", label: "auto", description: "Default. Quiet clicks; upgrade to real ones only when a site rejects them." },
|
|
@@ -580,7 +580,7 @@ Usage rules:
|
|
|
580
580
|
on: "on (always real-looking)",
|
|
581
581
|
};
|
|
582
582
|
const friendly = (m: string) => MODE_NAMES[m] ?? m;
|
|
583
|
-
const attached = status.attachedTabs?.length ? ` —
|
|
583
|
+
const attached = status.attachedTabs?.length ? ` — banner currently up on ${status.attachedTabs.length} tab(s)` : "";
|
|
584
584
|
const current = status.mode;
|
|
585
585
|
|
|
586
586
|
let target = rawArg;
|
|
@@ -592,8 +592,8 @@ Usage rules:
|
|
|
592
592
|
// Interactive picker. Plain-English descriptions; no jargon.
|
|
593
593
|
const options = [
|
|
594
594
|
`auto${current === "auto" ? " (current)" : ""} — quiet by default; if a site rejects a quiet click, retry it once with a real-looking click. Yellow banner appears only when needed. Recommended for everyday use.`,
|
|
595
|
-
`off${current === "off" ? " (current)" : ""} — always quiet. No
|
|
596
|
-
`on${current === "on" ? " (current)" : ""} — every click and keystroke uses a real-looking event.
|
|
595
|
+
`off${current === "off" ? " (current)" : ""} — always quiet. No banner, ever. Fast and unobtrusive, but some sites (sign-in pages, copy-to-clipboard buttons, file pickers, paywalls) will silently ignore the click.`,
|
|
596
|
+
`on${current === "on" ? " (current)" : ""} — every click and keystroke uses a real-looking event. A banner stays at the top of every Chrome window for the whole session, saying ‘Pi Chrome Connector started debugging this browser’. Best when working a stubborn site for a long stretch.`,
|
|
597
597
|
`status — just show me which mode is on right now.`,
|
|
598
598
|
];
|
|
599
599
|
const picked = await ctx.ui.select(
|
|
@@ -624,7 +624,7 @@ Usage rules:
|
|
|
624
624
|
if (target === "on" && current !== "on") {
|
|
625
625
|
const ok = await ctx.ui.confirm(
|
|
626
626
|
"Always use real-looking clicks?",
|
|
627
|
-
"Every click and keystroke pi-chrome sends will now look like a real human action to websites. This unlocks copy-to-clipboard buttons, sign-in pages, file pickers, fullscreen, autoplay, and most bot-protected sites.\n\nThe tradeoff: Chrome will pin a
|
|
627
|
+
"Every click and keystroke pi-chrome sends will now look like a real human action to websites. This unlocks copy-to-clipboard buttons, sign-in pages, file pickers, fullscreen, autoplay, and most bot-protected sites.\n\nThe tradeoff: Chrome will pin a banner at the top of every Chrome window saying ‘Pi Chrome Connector started debugging this browser’. The banner stays visible for the rest of your pi session (or until you switch back to auto/off). Clicking ‘Cancel’ on the banner interrupts pi-chrome.",
|
|
628
628
|
);
|
|
629
629
|
if (!ok) {
|
|
630
630
|
ctx.ui.notify("Mode unchanged.", "info");
|
|
@@ -636,13 +636,13 @@ Usage rules:
|
|
|
636
636
|
const result = (await bridge.send("trusted.mode", { mode: target }, 5_000)) as { mode: string };
|
|
637
637
|
if (result.mode === "on") {
|
|
638
638
|
ctx.ui.notify(
|
|
639
|
-
"On. Every click and keystroke now looks real to websites.
|
|
639
|
+
"On. Every click and keystroke now looks real to websites. A banner saying ‘Pi Chrome Connector started debugging this browser’ will appear on every tab pi-chrome touches.",
|
|
640
640
|
"info",
|
|
641
641
|
);
|
|
642
642
|
} else if (result.mode === "off") {
|
|
643
|
-
|
|
643
|
+
ctx.ui.notify("Off. All clicks are quiet now, no banner. Note: some sites (sign-ins, copy buttons, file pickers, paywalls) may silently ignore these clicks.", "info");
|
|
644
644
|
} else {
|
|
645
|
-
ctx.ui.notify("Auto. Clicks stay quiet by default; pi-chrome will only switch to real-looking clicks when a site rejects a quiet one. The
|
|
645
|
+
ctx.ui.notify("Auto. Clicks stay quiet by default; pi-chrome will only switch to real-looking clicks when a site rejects a quiet one. The Chrome banner will appear only when that retry happens.", "info");
|
|
646
646
|
}
|
|
647
647
|
} catch (error) {
|
|
648
648
|
ctx.ui.notify(`Couldn't switch mode: ${(error as Error).message}`, "warning");
|
|
@@ -849,7 +849,7 @@ Usage rules:
|
|
|
849
849
|
name: "chrome_click",
|
|
850
850
|
label: "Chrome Click",
|
|
851
851
|
description:
|
|
852
|
-
"Click a snapshot uid, CSS selector, or viewport coordinate. Default 'auto' mode runs synthetic DOM events first and silently retries with trusted CDP only when the click looks gated (no page change + affordance label matches play/copy/share/sign-in/etc, or a recent NotAllowedError). The
|
|
852
|
+
"Click a snapshot uid, CSS selector, or viewport coordinate. Default 'auto' mode runs synthetic DOM events first and silently retries with trusted CDP only when the click looks gated (no page change + affordance label matches play/copy/share/sign-in/etc, or a recent NotAllowedError). The 'started debugging' banner appears only when the retry actually happens. Pass trusted=true to force CDP for this call (banner appears immediately). Pass trusted=false to skip retry. Pass includeSnapshot=true to return a fresh snapshot after the click.",
|
|
853
853
|
promptSnippet: "Click page elements in Chrome by snapshot uid, selector, or viewport coordinate.",
|
|
854
854
|
parameters: Type.Object({
|
|
855
855
|
uid: Type.Optional(Type.String({ description: "Stable element uid from chrome_snapshot. Prefer uid over selector after taking a snapshot." })),
|
|
@@ -1176,7 +1176,7 @@ Usage rules:
|
|
|
1176
1176
|
name: "chrome_tap",
|
|
1177
1177
|
label: "Chrome Tap (Touch)",
|
|
1178
1178
|
description:
|
|
1179
|
-
"Dispatch a real browser-trusted touchstart/touchend tap via chrome.debugger (CDP Input.dispatchTouchEvent). Use for sites that gate on TouchEvent rather than MouseEvent (mobile-first PWAs, swipe carousels). Always uses the trusted CDP path — the
|
|
1179
|
+
"Dispatch a real browser-trusted touchstart/touchend tap via chrome.debugger (CDP Input.dispatchTouchEvent). Use for sites that gate on TouchEvent rather than MouseEvent (mobile-first PWAs, swipe carousels). Always uses the trusted CDP path — the 'started debugging' banner appears.",
|
|
1180
1180
|
promptSnippet: "Tap (real touch) a Chrome element by snapshot uid, selector, or coordinate.",
|
|
1181
1181
|
parameters: Type.Object({
|
|
1182
1182
|
uid: Type.Optional(Type.String()),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-chrome",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.4",
|
|
4
4
|
"description": "Drive your existing logged-in Chrome from Pi — no re-login, no throwaway profile, watch the agent work in real time (or toggle quiet background mode).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|