Expand description
New windows a browser paneโs page opens (docs/specs/SPEC_BROWSER_PANE_POPUPS_ADOPTED_2026_10_08.md, docs/specs/SPEC_BROWSER_PANE_NATIVE_POPUPS_AGENT_DRIVEN_2026_10_08.md).
Two kinds, by what the page asked for:
- popup panes (a link or window asking for a tab or window): srv opens
a browser pane beside the opener when the host asks
(
/api/v1/host/browser_popup); remembered here per opener. - popup windows (
window.openwith popup features): the host creates a native CEF popup itself and reports it (/api/v1/host/browser_popup_window); srv keeps who opened it and which agent, if any, may drive it.
Which requests are honored is agentmux_common::popup_rules, shared with
the host. Everything here is in memory, like ownership: after srv
restarts, popups are ordinary panes and windows nobody drives.
Structsยง
- Popup
Window ๐ - Popups ๐
- Reservation ๐
- A slot for a popup pane being opened, held from the moment it is admitted
until it is open (
commit) or not (dropped). Counting the slot during the wait is what keeps two popups admitted at once from both fitting under the cap.
Constantsยง
- CHAIN_
DEPTH_ ๐LIMIT - How deep
count_treefollows popups of popups. - POPUP_
FROM_ ๐META_ KEY - Block meta on a popup pane: the openerโs origin, shown as โPopup from โฆโ. Written only by srv.
- POPUP_
OF_ ๐META_ KEY - Block meta on a popup pane: the pane that opened it. Written only by srv.
- POPUP_
WINDOWS_ ๐META_ KEY - Block meta on an opener: its open popup windows,
[{id, url}], for the strip with Show and Close. Written only by srv.
Functionsยง
- clear_
windows ๐ - Forget the popup windows whose opener
oursrecognises (the host registered anew; seeui_handlers::reset_popup_windows). - count_
tree ๐ - Popup panes open or being opened anywhere below
node: its own, and theirs, and so on. Records stay with each popupโs direct opener, so when a pane in the middle of a chain closes, the subtree under it still counts for whichever pane is now its root. - decide ๐
- Is this request honored?
- is_
window_ ๐id - A popup windowโs id is the hostโs label for it.
- lock ๐
- mark_
popup_ ๐meta - Marks a new popup paneโs meta with its opener and the openerโs origin.
- open_
popups ๐ - The popups
openerhas open, oldest first.existssays whether a block is still there; closed ones are dropped from the record as theyโre found. - origin_
of ๐ urlโs origin (scheme://host[:port]), or empty if it isnโt http(s).- popups ๐
- prune ๐
- Drop
openerโs closed popups (existssays whether a block is still there) and return the open ones. - release ๐
- reserve ๐
- Admit one more popup pane from
openerifadmitagrees, given how many popup panes the chain it belongs to (rooted atroot) has open or being opened, and hold its slot. The count and the slot are taken under one lock. - strip_
value ๐ - The openerโs popup-windows strip, as written to its meta.
- window ๐
- window_
closed ๐ - The popup window closed. Returns its opener, if it was known.
- window_
navigated ๐ - The popup window navigated. Returns its opener, if it is known.
- window_
opened ๐ - Record a popup window the host created.
owneris the openerโs owner from srvโs own record, never anything the host or the page said. - windows ๐
- windows_
of ๐ openerโs open popup windows, oldest first.