Repository navigation
Page guards for owned tabs: other extensions' frames no longer wedge a tab; popups join the session; host logs refusals (#81) - #84
Merged
Conversation
…re Chrome detaches the debugger, route a page's window.open to the session; host sweeps and retries a foreign-frame attach refusal once and logs every refused extension request; spec Decision Log reverses 'no content scripts' for these two behaviours; extension 0.2.0, plugin 0.4.1
…d never for an unguard (an open dialog blocks chrome.scripting); an unguard racing a guard install wins; the popup interceptor runs in the top frame only and takes only new-context opens (no target or _blank), leaving named targets to Chrome
… 0/8), popup listed in the session without a claim, accept-chrome --route cua 40/40, vendor manifests unchanged; evidence, spec Progress and Surprises, debt; the stub's about:blank refusal now uses Chrome's wording
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…live): pm-probe 8/8 with no detach, popup in the session, accept-chrome --route cua 40/40, vendor manifests unchanged; evidence, spec Progress, debt
Owner
Author
|
Live rerun on the branch head after the owner reloaded the extension (so |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #81
The bug
On the cua route, focusing any field in a tab where another extension draws a frame (the owner's input-helper
pejdijmoenmkgeppbflobdenhhabjlaj, an invisible/completion_list.htmliframe) made Chrome detachchrome.debuggerand refuse every re-attach withCannot access a chrome-extension:// URL of different extension. The tab was then undrivable for its life. Same Chrome session: vendor route 8/8 twice, cua route 0/8.What the vendor extension actually does (read before implementing)
ChatGPT extension 1.26.901.11451,
background.js(Mh, also shipped ascontent-scripts/foreign-frame-monitor.js):chrome.dom.openOrClosedShadowRoot). For an<iframe>whosesrcis another extension'schrome-extension://URL it setssrcdoc=""; for a<frame>it setssrc="about:blank". It never removes or hides the element. A MutationObserver (childList, subtree,src) repeats this for every addition.chrome.scripting.executeScriptinto every document of a leased tab on every session request that touches the tab (requireSessionTab:attach,attachTarget,executeCdp,createTab,claimUserTab,markTab) and when a leased tab starts loading. So it is in place before each attach and catches frames as they are inserted (both). It is removed at turn end.Os) has no retry of its own. Recovery is the service's re-attach, which finds the frame already blanked.Rhin the page world, a bridgekhin the isolated world) sits behind a Statsig gate (codex-app-chrome-extension-background-popups). It replaceswindow.openand target-link clicks with a request; the extension turns that into a background tab claimed for the session. It also claims any child tab throughwebNavigation.onCreatedNavigationTarget.What this PR builds
scriptingandhost_permissions: ["<all_urls>"]. No declared content script; injection works the way the vendor's does, and only into tabs the host owns (a user's other tabs never see cua code).pageGuard(isolated world, every frame) blanks other extensions' frames the way the vendor does, on insertion and on the host's sweep. The sweep waits up to 1 s for the frames to unload.pagePopups(page world, top frame only) takes a user-activatedwindow.open(no target, or_blank) or a_blanklink of an http(s) URL. It gives the page a stand-in window. Sized popups, which needwindow.opener, named targets and sandboxed frames are left to Chrome.tabs.guard/tabs.unguard;tabs.create {openerTabId, guard}; a new notificationtabs.popup. Each new document is guarded at commit.Cannot access a chrome-extension://gets one more sweep and one retry.tabs.popupfrom the current turn's tab becomes a created tab of that turn, the session's active tab.test/helpers/fake-page.mjs) runs the serialized page functions in two vm worlds under the chrome stub. The stub refuses the attach while another extension's frame is committed, and detaches when such a frame commits.Live (this Mac, helper enabled;
docs/evidence/2026-10-07-foreign-frames-acceptance.md)srcdoc="". No attach refusal at all.window.openfrom an agent tab was listed bycua.listTabs()4 ms after the click, session-owned (origin: created), with no claim.accept-chrome --live --route cua: 40/40 PASS. Vendor manifests sha256 unchanged.59bbcf5. The review fixes ind7970a5are proven under the stub only and need an extension reload.tech-debt-tracker.md):Review
One opus reviewer on the high-rung brief found one P2: an open JS dialog would make attach and turnEnded hang on the guard injection. It also found three P3s: a guard/unguard race, named targets across frames, and the popup bridge in sandboxed frames. All four are fixed with tests in
d7970a5.