aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2026-11-08tabs: back to one window per session; keep new tabs out of the user's windowIgor Soarez
A window shows only one tab, so sessions sharing one hid each other's tabs: no real input and blank screenshots for every session but the one whose tab was active (castle-pirc-web, 2026-11-08). Time-sharing the active tab would flip tabs under the user while they sign in for an agent, so revert 66fbd30: a session gets its own unfocused window. Kept: chrome_tab new for a session with no window opens one for it instead of landing in the user's focused window. The primer and chrome_tab description now say why to reuse a tab.
2026-11-08chrome_clear_overlay: say the prompt may not return until the page is reloadedIgor Soarez
2026-11-08overlay.clear: read closed shadow roots and remove the host elementIgor Soarez
Diagnostics on 1Password's inline prompt: the page holds a <com-1password-uso> element and no iframe in its own DOM; the frame is inside a closed shadow root. Run in the isolated world, where chrome.dom.openOrClosedShadowRoot can read it, and remove the element that hosts a foreign extension frame. Drop the body-click events: they were never shown to help.
2026-11-08overlay.clear: match the prompt's frame by the tabId in its URL, and report ↵Igor Soarez
what it saw The password manager's frame target can come without a tabId, so it was missed (error said 'unknown', remaining targets empty). Match by the ?tabId= in the frame URL too, and when the tab stays blocked report every foreign target and what the injected script saw, so the next step is based on data.
2026-11-08overlay.clear: run in the page's own world with the click the fallback usesIgor Soarez
The isolated-world body events did not free a 1Password-blocked tab; the DOM click fallback (MAIN world, full pointer event shape, el.click()) did. Use that shape, aimed at the page root so no control is clicked.
2026-11-08overlay.clear: click the page body outside the prompt, and wait for it to goIgor Soarez
Measured on 1Password's inline menu: blur and Escape did not free the tab, a click outside did. overlay.clear now also sends pointer/mouse events to the body and polls the debugger for about a second instead of checking once.
2026-11-08overlay: the agent decides whether a password-manager prompt is in the wayIgor Soarez
The error, the tool description and the primer no longer tell the agent to ask the user first. It clears the prompt when it is only in the way, and leaves it alone and says so when it is waiting for the user to sign in or approve.
2026-11-08overlay: tell the agent about a blocking password-manager prompt; ↵Igor Soarez
chrome_clear_overlay closes it on request Another extension's frame (1Password's inline prompt) makes Chrome refuse the debugger on the tab. The old path sent Escape on its own, which cannot reach that frame and would close a prompt the user may be using. Now nothing is closed automatically: the error says what is blocking and tells the agent to ask the user; chrome_clear_overlay removes the frame, blurs the field, sends Escape and reports whether the tab is usable again.
2026-11-08navigate: do not require the debuggerIgor Soarez
Attaching first (for the Leave-site prompt) made chrome_navigate fail on a tab whose page holds another extension's frame, such as a 1Password inline prompt, which is exactly when navigating away is the way out. Attach is now best effort.
2026-11-08tabs: agent sessions share one window instead of opening one eachIgor Soarez
A session's first tab used chrome.windows.create, so every new session name (and every Claude Code process) got its own window. It now goes into the window that already holds any 'Pi Session:' group; a window is created only when none exists. chrome_tab new for a session with no group also uses that window, not the user's focused one. The primer and the chrome_tab description say so.
2026-11-08navigate: answer a page's Leave-site prompt instead of hangingIgor Soarez
A page with a beforeunload handler shows 'Leave site?' when the extension navigates away. Nothing answered it, so chrome_navigate waited out its timeout and the agent never learned why. The worker now hears Page.javascriptDialogOpening and dismisses the dialog (stay/cancel); page.navigate fails at once and says so. leaveIfAsked: true, for that call only, accepts a beforeunload prompt. Tool description and primer tell agents when to use it and to ask the user when unsure.
2026-11-06extension: end a /chrome authorize grant with its sessionIgor Soarez
The grant lives on globalThis so /reload keeps it, but nothing cleared it when pi replaced the session in the same process. After /new, /resume or /fork the next session started authorized and announced it in the footer. Drop the saved grant on session_shutdown for new, resume and fork. Reload keeps it. Quit leaves it alone, so a subagent quitting in the same process does not take its parent's grant with it. grant-scope.test.mjs loads the shipped module once per runtime in one shared context, the way pi keeps globalThis across reloads and switches, and checks the tools and the footer after each. It fails on 85b4988, and its /chrome authorize cases fail with only the PI_CHROME_AUTHORIZE fix.
2026-11-06extension: keep PI_CHROME_AUTHORIZE grants out of the persisted grantIgor Soarez
The env grant was saved to globalThis like a /chrome authorize grant. After a /reload or a session switch (/resume, /fork, /new) the new runtime restored it, skipped the env branch, and left envGranted false, so the footer announced a grant the user never gave. Read the variable again on each session_start instead of persisting it. A restored grant now always comes from /chrome authorize. A timed env grant restarts its countdown on each reload or switch.
2026-11-06broker: refuse uploads from outside the staging directoryIgor Soarez
page.upload and a raw DOM.setFileInputFiles through cdp.call now have to name files whose real path is under /tmp/pi-chrome-uploads (PI_CHROME_UPLOAD_DIR), on the broker's host. Anyone holding the token could otherwise attach any file the user can read to a page.
2026-10-26extension: show the bridge footer only for grants given this sessionIgor Soarez
A standing PI_CHROME_AUTHORIZE is not session state worth a line at the bottom of every session that has it; announce only access the user granted through /chrome authorize.
2026-10-15mcp: pi-chrome-mcp joins the fork as sz-chrome-remote-extension, loading the ↵Igor Soarez
fork's own extension
2026-10-15pi-chrome 0.15.57: stand in for pi-tui, collect the primer from prompt sectionsIgor Soarez
2026-10-02pi: native MCP instead of pi-mcp-adapterIgor Soarez
pi 0.99+ ships MCP as a built-in, and the adapter suppresses it. The gate moves from the adapter's approval event, which the built-in never emits, to pi's own tool_call hook on mcp__<server>__*, which every call passes through, codemode included. approveTools went with the adapter, so nothing backs the gate up: a decision it cannot reach now denies rather than throws. server.mjs also treats a client named plain "pi" as pi, which is how the built-in introduces itself. From change request 562974, filed from the work laptop.
2026-09-25ship the pi side we actually run, not a different arrangementIgor Soarez
The README told pi users to install pi-chrome directly and run /chrome authorize every session. That is not how this is used: pi reaches the same MCP server through pi-mcp-adapter, with pi's own pi-chrome switched off, which is why nobody types /chrome authorize. pi/browser-gate.ts is that setup's missing piece, generalised from the one in use: it answers pi-mcp-adapter's approval broker for one server, asking once per session instead of once per call (the adapter's own grant only covers identical arguments, so for a browser it asks nearly every time). /browser authorize, /browser revoke, and PI_BROWSER_AUTHORIZE for headless runs. approveTools stays on in mcp.json as the backstop if the gate does not load. The README now leads with that: install the adapter, register the server in mcp.json, copy the gate. Installing pi-chrome in pi is kept as the alternative, with what it costs - two definitions of the browser, /chrome authorize per session, and the trap of loading the extension twice. Tested on an isolated pi config against a stand-in browser: with PI_BROWSER_AUTHORIZE the call reaches the browser, without it the gate denies it.
2026-10-14FORK.md: what the fork changes, setup, upstream releasesIgor Soarez
2026-10-14feat(remote): drive a companion extension on another host through a brokerIgor Soarez
PI_CHROME_REMOTE=host:port sends every command to a broker/broker.mjs there, with its bearer token, instead of binding a bridge on this machine. Unset, the extension behaves as upstream. A remote session never binds or takes over a port: when the broker is unreachable the tools fail rather than drive some other browser. A pi-chrome-remote prompt section says which browser chrome_* drives and how files move to and from its host; chrome_upload_file wants absolute paths there. PI_CHROME_AUTHORIZE grants every session up front.
2026-10-14broker: a standalone bridge for the browser's hostIgor Soarez
Upstream's bridge lives inside whichever pi session started first on the machine running the browser, and only serves that machine. The broker takes its place permanently: upstream's HTTP contract to the extension on loopback, and /command and /status on a second, private address for other hosts, behind a bearer token (PI_CHROME_TOKEN, or PI_CHROME_TOKEN_COMMAND).
2026-09-28Release 0.15.57 (#28)Tianren Dong
2026-09-28Drop the full-screen tab rule for automation targets (#27)Tianren Dong
0.15.54 opened Pi's automation target as a tab in the user's window while it was full screen, assuming macOS would merge a new window into it as a hidden window tab. Chrome disables automatic window tabbing (app_controller_mac.mm), so that never happens; the hidden tabs came from the tab-group bug fixed in 0.15.56. Always prefer Pi's own window.
2026-09-28Report hidden Pi tab in /chrome doctor (#26)Tianren Dong
Chrome ignores clicks and typing in hidden pages. Doctor now asks the worker whether this session's own tab is visible (automation.status includeVisibility, which never creates or activates a tab) and reports the reason and fix when it is hidden.
2026-09-28Keep tab ownership across extension reloads (#25)Tianren Dong
storage.session is wiped when the extension reloads, which it does on every pi-chrome update, so Pi lost track of its automation window and session tabs and left them behind. Mirror ownership to storage.local, restore it only when the session copy is missing, re-check every restored tab (same window; adopted tabs still in Pi's group), and drop the local copy on browser startup.
2026-09-28Merge pull request #24 from tianrendong/fix/fill-textarea-and-new-tab-captureTianren Dong
Fill whole textareas; cover new tabs' first page with early capture
2026-09-28Create session tab groups in the tab's own windowTianren Dong
chrome.tabs.group without createProperties.windowId creates the group in the current (user's) window and moves the tab there, so a session's automation tab left its dedicated window and became a hidden inactive tab. Make the unit mock match Chrome's behavior.
2026-09-28Release 0.15.56Tianren Dong
2026-09-28Fill whole textareas; cover new tabs' first page with early captureTianren Dong
chrome_fill's triple-click selected one line of a multi-line textarea, so fill replaced only that line. Select value fields with the selectAll editing command before deleting. Early capture now waits for in-flight tab.new creations, so a first page that commits before the tab is tracked is still captured.
2026-09-26Release 0.15.55Tianren Dong
2026-09-26Merge pull request #23 from tianrendong/fix/cache-friendly-primerTianren Dong
Make Chrome primer and authorization log prompt-cache friendly
2026-09-26Make Chrome primer and authorization log prompt-cache friendlyTianren Dong
- Contribute the primer as a structured prompt section instead of forcing systemPrompt. - Log pi-chrome-tool-change as a rendered custom entry that is not sent to the model.
2026-09-26Merge pull request #22 from tianrendong/fix/early-capture-scopeTianren Dong
Stop console capture from tripping DevTools detection; scope early capture to Pi tabs
2026-09-26Stop console capture from tripping DevTools detection; scope early capture ↵Tianren Dong
to Pi tabs Fixes #9. Sites like BOSS Zhipin log an object with a getter/toString trap and close the tab if it is read. Store captured console args raw and serialize them on read without running page code (data properties only, accessors as [getter], built-ins via native getters). Inject document-start capture only into Pi's automation tab and session-tracked tabs.
2026-09-26Merge pull request #21 from tianrendong/fix/hidden-input-uploads-screenshotsTianren Dong
Report hidden-tab input, append targeted typing, smarter uploads, prune screenshots; release 0.15.54
2026-09-26Report hidden-tab input, append targeted typing, smarter uploads, prune ↵Tianren Dong
screenshots; release 0.15.54 - Check page visibility before trusted input: Chrome drops input to hidden pages (inactive tabs, covered/minimized windows, macOS window tabs behind full screen). Type/key/hover/scroll/tap/drag fail fast with the reason; click/fill use their DOM fallback immediately (or reject with domFallback:false). - Use an inactive tab instead of a new window for the automation target while the user's window is full screen. - chrome_type with uid/selector moves the caret to the end (moveToEndOfDocument) after its focus click. - chrome_upload_file: labels/wrappers resolve to their file input, same-origin iframe search, and intercepted file chooser for upload buttons (trusted click when visible, user-gesture click when hidden); reject multiple paths for single-file inputs; no duplicate change event. - Prune default-folder chrome_screenshot captures (7 days, newest 20 kept, retentionDays override). - input.debug without a target no longer calls tabs.get(-1). - New hidden-input unit suite.
2026-09-26Merge pull request #20 from tianrendong/feat/absorb-fork-featuresTianren Dong
Absorb fork fixes and features; release 0.15.53
2026-09-26Absorb fork fixes and features; release 0.15.53Tianren Dong
Adapted from community forks (ardhiqii, kkunkunya, nihar-oracle, steimerbyte): - Abort stalled /next long polls after 45s; time out, retry, and single-post results. - Fall back to CDP Runtime.evaluate when chrome.scripting is refused (about:blank automation tabs). - Load pi-chrome in same-process subagent sessions as a bridge client; client chrome_launch reports owner status. - Add chrome_cdp (validated raw CDP passthrough, background-guarded, payload summarization) and chrome_cdp_targets. - chrome_type reports before/after values, insertedAt, splice/unchanged warnings; add replace=true. - includeSnapshot waits for navigations started by the action; tab.new reports the settled tab. - CDP timeouts surface as timeouts and are not re-sent after the cleanup detach. - Activate/deactivate chrome_find and chrome_inspect with the rest of the chrome_* tools. - New unit suites: bridge-resilience, cdp-passthrough, type-evidence.
2026-09-10Merge pull request #17 from tianrendong/refactor/chrome-command-surfaceTianren Dong
Simplify Chrome status commands and release 0.15.51
2026-09-10Simplify Chrome status commands and release 0.15.51Tianren Dong
2026-09-10Merge pull request #16 from tianrendong/docs/readme-0.15.50Tianren Dong
docs: clarify background controls and release 0.15.50
2026-09-10docs: clarify background controls and release 0.15.50Tianren Dong
2026-09-10Merge pull request #15 from tianrendong/docs/readme-onboardingTianren Dong
docs: improve pi-chrome README and onboarding
2026-09-10docs: improve pi-chrome README and onboardingTianren Dong
2026-09-10Merge pull request #14 from tianrendong/fix/input-reliabilityTianren Dong
Improve Chrome input reliability and release 0.15.49
2026-09-10Improve Chrome input reliability and release 0.15.49Tianren Dong
2026-09-09Merge pull request #13 from tianrendong/fix/hard-background-policyTianren Dong
Enforce hard background and release 0.15.48
2026-09-09Enforce hard background and release 0.15.48Tianren Dong
2026-09-09Merge pull request #12 from tianrendong/fix/session-cleanup-safetyTianren Dong
Fix session cleanup and release 0.15.47