@@ -880,14 +880,14 @@ under the session user's home (`.config/chromium` by default), whose contents fr
880880are the profile's template. The base class adds:
881881
882882- ** Its settings** , ` BrowserSettings ` , which a subclass's ` Settings ` extends: ` start_urls ` , opened in
883- tabs at launch, the first active (` ["about:blank"] ` by default; none may start with ` - ` ), headless
884- the first from its command line and the rest over its pipe, since headless Chromium takes one; ` window ` ,
883+ tabs at launch, the first active (` ["about:blank"] ` by default; none may start with ` - ` ); ` window ` ,
885884 1280 × 800, alone only; ` locale ` ; ` time_zone ` , set as ` TZ ` in its launch's ` env ` ; ` geolocation ` and
886885 ` notifications ` , ` deny ` (the default), which answers a page's prompt for it, or ` ask ` ; and ` dialogs ` , who
887886 answers a page's JavaScript dialogs: ` agent ` (the default), or agentenv, accepting (` accept ` , a ` prompt() `
888887 with its default text) or dismissing (` dismiss ` ) each. Either way agentenv leaves a page that asks before
889888 it's left (` beforeunload ` ), so none of its answers blocks a navigation.
890- - ** The flags agentenv owns** , after the subclass's command and before the start tabs: its profile, its
889+ - ** The flags agentenv owns** , after the subclass's command and before ` about:blank ` , the one tab its command line
890+ opens: its profile, its
891891 HTTP cache under ` ~/.cache ` (` --disk-cache-dir ` ), ` --remote-debugging-pipe ` , ` --no-first-run ` ,
892892 ` --no-default-browser-check ` , ` --lang ` and, when ` /dev/shm ` holds under 1 GiB (Docker gives 64 MiB),
893893 ` --disable-dev-shm-usage ` , so it keeps its shared memory in files. With
@@ -946,6 +946,8 @@ are the profile's template. The base class adds:
946946 - ` files/choose {paths} ` , files in ` ~/Uploads ` for the file chooser open on it, which headless, and so
947947 alone, it intercepts;
948948 - ` page/state ` , the active tab's id, URL and title and the dialog or file chooser open on it.
949+ - ` sites/set {sites} ` , the env's own sites, each ` {name, domains} ` , a ` *. ` domain matching one label more, which
950+ the deploy hands it before it launches the browser and its server keeps for every launch after.
949951 - ` cookies/get {urls?} ` , ` cookies/set {cookies} ` and ` cookies/delete {name?, domain?, path?} ` , on its default
950952 context, each cookie as Playwright's ` storageState ` has it, CDP's ` Network.Cookie ` fields (` name ` , ` value ` ,
951953 ` domain ` , ` path ` , ` expires ` , ` httpOnly ` , ` secure ` , ` sameSite ` ), so a storage state exported from Playwright loads
@@ -968,9 +970,26 @@ are the profile's template. The base class adds:
968970 under the ` write_namespace ` grant when there is one, else inline, as ` data/get ` returns files. Inline, the whole
969971 file is read into memory and sent base64 in one answer, so a large one belongs under a grant.
970972
973+ ** Start tabs.** At each launch its start tabs open over its pipe, in a computer and alone alike: the first in the
974+ blank tab its command line opened, the rest in tabs it opens blank after it, each held to the window's size
975+ (headless) before it goes to its URL, so its page sees that size from its first script; then the first is brought
976+ to the front. They load at once, and each settles once it has loaded (its load event fired, its document's final
977+ status read), once it failed (a network error, or on one of the env's sites, as ` sites/set ` named them, a 4xx or
978+ 5xx status, which settles it at once), or once it has been waited on: every one settles within the browser's
979+ ready timeout of its launch, the launch's setup counted against it, a tab on one of the env's sites waited on what's
980+ left of it and any other on 30 s at most, so ` data/reset ` , a load and a deploy, which wait that timeout and a margin,
981+ always get its outcome. Its ` start_tabs_loaded ` ready check passes once all have settled, so ` cdp ` and a deploy wait
982+ for them. ` record ` 's ` start_tabs ` keeps each launch's (` StartTabsLaunch ` : ` at ` and its
983+ ` tabs ` , each a ` StartTab ` : ` tab ` , ` url ` , ` final_url ` , ` status ` , ` error ` , ` load_ms ` , ` site ` — the env's site's
984+ name, null for a live one — and ` outcome ` , ` loaded ` , ` failed ` or ` timed_out ` ), and ` data/get ` 's state keeps its
985+ latest launch's. A deploy of a computer reads them once it's ready, keeps them in its record and fails, naming
986+ each, if one on the env's sites didn't load; ` data/reset ` and a load that opens the start tabs again fail
987+ the same way, while a server's restart only records it.
988+
971989 The browser's data plane is a file tree, every file by its path under the session user's home:
972990 - ` data/get ` returns its state as ` browser-state.json ` (` BrowserState ` : ` cookies ` and ` local_storage `
973- as above, ` tabs ` , ` closed_tabs ` , ` downloads ` and ` clock ` , ` real ` with its ` now ` ); its profile's files,
991+ as above, ` tabs ` , ` closed_tabs ` , ` downloads ` , ` clock ` , ` real ` with its ` now ` , and ` start_tabs ` ); its
992+ profile's files,
974993 each database with its journal or log, copied in one pass with the browser paused once its state is
975994 read, so the files are of one moment, without caches (` Cache ` , ` Code Cache ` ,
976995 ` GPUCache ` , the shader and Dawn caches, ` CacheStorage ` , ` ScriptCache ` , ` Crashpad ` ) or locks
0 commit comments