Skip to main content

Module popup_rules

Module popup_rules 

Source
Expand description

Which new windows a browser pane’s page may open inside AgentMux (docs/specs/SPEC_BROWSER_PANE_POPUPS_ADOPTED_2026_10_08.md §3.1, docs/specs/SPEC_BROWSER_PANE_NATIVE_POPUPS_AGENT_DRIVEN_2026_10_08.md §3).

Shared by the CEF host, which must decide inside on_before_popup (creating a native popup is that callback’s return value, so it can’t wait on srv), and srv, which re-checks before it opens a pane.

Enums§

Refusal
Why a request is not honored. The caller does what it did before this existed (the system browser, or the pane’s own frame for a link).

Constants§

MAX_POPUPS_PER_PANE
New windows one pane may have open at once, per kind (popup windows, popup panes). Beyond it, they go to the system browser.

Functions§

decide
Is this request honored?
is_loopback
Is url on this machine’s loopback (localhost, 127.0.0.1, [::1])?
loopback_allowed
May a page on loopback open a window to url, also on loopback? Only on its own origin (a local dev site opening its own popup), and never one of AgentMux’s own (own_origins: its frontend and srv), which a page must not be able to put in front of the person (native-popups spec §3).
origin_of
url’s origin (scheme://host[:port]), or empty if it isn’t http(s).
popup_window_title
The title for a popup window, which has no address bar: where it is, then the page’s own title, e.g. accounts.google.com — Sign in (native-popups spec §8.4, N2). A page can set its title to anything, so the part it can’t set comes first. None for an address with nothing to show (devtools: and the like): leave the title as the page set it.
same_site
Do both URLs belong to the same site: the same registrable domain under the public suffix list (console.example.com and signin.example.com do; a.github.io and b.github.io don’t)? A host with no registrable domain (an IP address, localhost) matches only itself.