Skip to main content

Module allowed_origins

Module allowed_origins 

Source
Expand description

The sites an agent’s browser pane may go to, when the agent limited it with OpenBrowser({allowed_origins}) (docs/specs/SPEC_BROWSER_PANE_ALLOWED_ORIGINS_2026_10_09.md §2).

Shared by srv, which checks the list it is given and re-checks every request, and the CEF host, which stops a navigation off the list before it happens. A list is kept in its normal form (parse): https://example.com, https://*.example.com, http://localhost:3000.

Constants§

MAX_ENTRIES
Most entries one pane’s list may have.

Functions§

allows
May a pane limited to list (normal form) go to url? about: pages always; any other address with no web origin, never.
bare_origin
url as an origin and nothing else: the origin (target_origin) when url names no more than one (no path beyond /, no query, fragment or user information), else None. What a saved site is stored as when it is only an origin written another way (HTTPS://Example.com:443/ becomes https://example.com); an address with a path is a login’s own page and is left as it was typed.
parse
entry in its normal form, or why it isn’t a valid entry:
parse_list
Parse every entry of entries, deduplicated, in order. Fails on the first bad entry, or past MAX_ENTRIES.
same_origin
Whether a and b name the same origin: the same scheme, host (any case) and port (the scheme’s default when absent), whatever else either carries (a trailing slash, a path, a query, user information). Never true for another host, port or scheme. An address with no web origin is the same as another only when written the same.
target_origin
The origin a navigation to url goes to, as an entry would name it exactly (a blob: URL’s is the origin it belongs to). None for an address with no such origin (about:, data:, a blob: address that carries another blob: address).