aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorTJ Dong <122852285+tj-dong@users.noreply.github.com>2026-06-22 16:55:20 -0700
committerGitHub <noreply@github.com>2026-06-22 19:55:20 -0400
commitb8165967408be47e93b6a566270988177f8f6866 (patch)
tree58cb4999702566a24a0384a35c0b9aab1db3c121 /README.md
parentdce772f330db12a73e85297918882c0c4f28f030 (diff)
0.15.39: dedicated pi-chrome automation tab/window isolation (#6)
Stop pi-chrome from hijacking the user's active tab. Page/navigation actions with no explicit target now route to a dedicated automation window owned by the calling Pi session (falling back to a dedicated tab if a window can't be made), instead of overwriting whatever the user has open. - Session-scoped ownership: Map<sessionKey, target> in the service worker, keyed by a sessionKey forwarded from index.ts, so concurrent sessions (one shared extension) never fight over a window or close each other's tabs. - Persistence: ownership mirrored to chrome.storage.session so a service-worker restart re-hydrates and reuses the window instead of orphaning it. Cleared on full browser restart; restored windows are then left alone (never reclaimed). - getTabByParams default branch resolves the owned target; tab.activate/close/ group/ungroup pass createOwnedTarget:false so management never auto-creates a throwaway tab or falls back to the user's active tab. - Session-group integration: the dedicated-window tab still joins this session's tab group, in its own window; grouping stays best-effort. - Lifecycle: cleanup on /chrome revoke and real session end (not /reload); fire-and-forget so it never blocks /quit, /reload, or shutdown. - Tests: new test-suite/unit/automation-target.test.mjs (isolation, reuse, concurrency, restart/reconnect re-hydration, guarded tab.*, group integration, window->tab fallback, robust cleanup). Docs + CHANGELOG updated.
Diffstat (limited to 'README.md')
-rw-r--r--README.md11
1 files changed, 11 insertions, 0 deletions
diff --git a/README.md b/README.md
index 4a35f38..7b762ea 100644
--- a/README.md
+++ b/README.md
@@ -173,6 +173,17 @@ Agents can verify page state immediately instead of blindly retrying.
Each tool is documented inline in Pi — agents see the parameters and gotchas (Chrome input, CSP limits, file upload behavior) without trial-and-error.
+### Tab/window isolation
+
+pi-chrome never overwrites the tab you're currently looking at. The first time a chrome_* action runs without an explicit target, pi-chrome opens a **dedicated automation window** (falling back to a dedicated tab if a separate window can't be created) and reuses it for the rest of the session. Your existing tabs and windows are left untouched. To point pi-chrome at a specific tab you already have open, pass `targetId`/`urlIncludes`/`titleIncludes`.
+
+Details:
+
+- **Per session.** Each Pi session owns its *own* automation window, so concurrent sessions (which all share one companion extension) never fight over a tab.
+- **Survives `/reload` and Chrome service-worker restarts.** Ownership is tracked by id and mirrored to `chrome.storage.session`, so the window is reused rather than orphaned.
+- **Cleanup is safe.** The dedicated target is closed when you revoke Chrome control (`/chrome revoke`) and on real session end — never on `/reload`. Cleanup only ever closes the calling session's own automation window/tab; user tabs/windows and other sessions' targets are never closed. Cleanup is fire-and-forget so it never blocks `/quit`, `/reload`, or session end.
+- **Management actions are guarded.** `chrome_tab` `activate`/`close`/`group`/`ungroup` with no explicit target act on the session's automation tab if it exists, otherwise they error instead of touching your active tab.
+
### Known limits vs. human Chrome use
pi-chrome is strongest on web-page workflows exposed through DOM, screenshots, tabs, and Chrome input. It is not a full human/OS substitute. Current limitations include native Chrome/OS surfaces (print/save dialogs, permission bubbles, password-manager prompts), cross-origin iframe DOM access, rich multitouch/pinch/stylus gestures, visual CAPTCHA/bot challenges, hardware-backed auth (passkeys/security keys/biometrics), and arbitrary OS app interaction. For strict-CSP pages, use screenshot + coordinate input when `chrome_snapshot`/`chrome_evaluate` are blocked.