Skip to main content

Module browser_popup

Module browser_popup 

Source
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.open with 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ยง

PopupWindow ๐Ÿ”’
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_tree follows 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 ours recognises (the host registered anew; see ui_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 opener has open, oldest first. exists says 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 (exists says whether a block is still there) and return the open ones.
release ๐Ÿ”’
reserve ๐Ÿ”’
Admit one more popup pane from opener if admit agrees, given how many popup panes the chain it belongs to (rooted at root) 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. owner is 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.