Theia API Documentation v1.76.0
    Preparing search index...

    Holds the parsed CLI options of forwarded launches (see the second-instance handling in ElectronMainApplication) in the trusted Electron main process, keyed by the webContents id of the window that was opened for them.

    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-preference there 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 by event.sender.id rather 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. See TheiaElectronWindow.reload.

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    argsByWindowId: Map<number, LaunchArguments> = ...

    Methods

    • Experimental

      Returns 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.

      Parameters

      • windowId: number

      Returns undefined | LaunchArguments

    • Experimental

      Associates 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.

      Parameters

      Returns void