ExperimentalExperimentalExperimentalDrops the arguments stored for windowId. Called when the window is closed, and when it is
redirected to a different frontend.
ExperimentalReturns the parsed launch options for the window identified by windowId, or undefined
for a window that was not opened by a forwarded launch (a cold-start window), or one whose
arguments were dropped. Repeatable, so a plain reload still sees the arguments.
ExperimentalAssociates the parsed options of a forwarded launch with the window identified by windowId (its
webContents id). Must be called before the window loads its URL, so that the preload script
cannot ask for the arguments before they are stored.
Holds the parsed CLI options of forwarded launches (see the
second-instancehandling inElectronMainApplication) in the trusted Electron main process, keyed by thewebContentsid of the window that was opened for them.Why the arguments never travel on the window URL
The URL is the one channel in the system that carries no trust: in a browser deployment it is attacker-writable, so putting per-window options such as
--session-preferencethere would let a crafted link inject settings (some of which persist to the User scope). The arguments therefore stay here in the main process and are handed to the window over the per-window metadata channel (CHANNEL_WC_METADATA), where main identifies the calling window byevent.sender.idrather than by any value from the URL. This is the single place that documents that rationale; other files point here.The entry is not consumed on first read, so that a plain
Reload Window, which re-runs the renderer against the same window, still observes the arguments. It is removed when the window is closed, and when the window is redirected to a different frontend (e.g. into a dev container after a CLI attach), since the arguments describe the launch rather than whatever the window is navigated to afterwards. SeeTheiaElectronWindow.reload.