Skip to main content

Module chromium

Module chromium 

Source
Expand description

The server-side Chromium: found, started once with a profile of its own and a CDP pipe, shared by the panes, and stopped when the last pane has been gone a while. docs/specs/SPEC_STREAMED_BROWSER_PANE_DEMO_2026_11_15.md §2 and §3.

Structs§

Lease
A pane’s hold on the browser; letting go of it frees its place.
Pool 🔒
Slots
How many panes are open, held to a limit.

Constants§

BINARY_ENV
A path to the Chromium binary, when it is not on the PATH under a usual name.
ENV_KEEP 🔒
The environment variables Chromium gets, and nothing else: it opens pages from the web, so it gets none of srv’s own (the key, the local address) and none of the platform’s (cloud credentials, injected secrets).
IDLE_STOP 🔒
How long Chromium is kept after its last pane closed.
MAX_PANES
At most this many panes at once: a CPU budget, not a memory one (report finding 4).
NO_SANDBOX_ENV
1 in the environment asks --no-sandbox (the demo only).
TAIL_LINES 🔒
How many of Chromium’s last stderr lines are kept, and how long each may be.
TAIL_LINE_CHARS 🔒
USUAL_NAMES 🔒

Statics§

HOST_PROFILE 🔒
The profile folder a browser host was given: it has no data directory, and its profile is one fresh folder.

Functions§

allowed_env
vars cut down to the ones Chromium may have.
args
The Chromium arguments: headless, its own profile, its pipe, nothing it does not need, and the one way out it has: the address proxy on proxy_port (address_proxy). Every connection goes through it, names are resolved by it (a local lookup is made to fail), and no route around it is left: no QUIC (UDP), no WebRTC over UDP that is not proxied, no DNS prefetch.
find_binary 🔒
keep_child 🔒
Hold the process until the browser’s pipe closes, then reap it.
keep_stderr_tail 🔒
Drain Chromium’s stderr (so the pipe never fills), keeping the last few lines for a start that fails.
lease
A place in the shared browser, starting it when it is not running.
pipe_pair 🔒
A pipe, both ends close-on-exec and above descriptor 4, so dup2 onto 3 and 4 never lands on one.
pool 🔒
profile_dir 🔒
The profile folder: under srv’s data directory, never a desktop profile.
profile_under
The profile folder under a data directory: nothing else is ever a profile of this browser.
route_windows 🔒
The browser’s new and ended pages are told to the pane that owns them (popups): a window a pane’s page opens is shown by that pane. A page no pane lists is closed as it appears, with an opener or without one. The page the browser started with (blank) is srv’s own and is kept, so it is marked before news of pages is asked for.
running 🔒
start 🔒
starting 🔒
Starting the browser is one at a time: two panes opened together must not start two Chromiums on one profile.
use_profile_root