electron-agent-bridge
    Preparing search index...

    Talks to the page agent of one page (top frame) through CDP:

    • bootstraps lazily and again after every re-attach (fresh CDP session): posts Runtime.enable and registers the agent for every new document in its isolated world (runImmediately covers the current one);
    • tracks the agent world's execution context per frame from Runtime events;
    • when the context is missing (navigation in progress, page loaded before the bridge), creates the world itself and installs the agent; the agent's install is idempotent.
    Index
    • Send a setup command once per CDP session (e.g. Accessibility.enable, Network.enable): it stays in effect until the session ends, and is sent again after a re-attach. Fire-and-forget. Returns true when the command was sent now (the first time on this session).

      Parameters

      • method: string
      • Optionalparams: object

      Returns boolean

    • Parameters

      • locator: {
            css?: string;
            exact?: boolean;
            name?: string;
            nth?: number;
            ref?: string;
            role?: string;
            text?: string;
        }
      • limit: number

      Returns Promise<{ matches: Match[]; total: number }>

    • Undo the memory of an ensure (after the caller reverted the command's effect).

      Parameters

      • method: string
      • Optionalparams: object

      Returns void

    • Install the agent in the page now and in every later document (fire-and-forget), without waiting for a first call: for features that must see the page from its start (recording).

      Returns void

    • Call any page agent operation (sync or async) and unwrap its result.

      Type Parameters

      • T

      Parameters

      • method: string
      • args: readonly unknown[]

      Returns Promise<T>

    • Refs of the page tree (or of root's subtree), in document order.

      Parameters

      • limit: number
      • Optionalroot: {
            css?: string;
            exact?: boolean;
            name?: string;
            nth?: number;
            ref?: string;
            role?: string;
            text?: string;
        }

      Returns Promise<string[]>

    • Run use with a remote object handle for each ref's element (for CDP calls that need a node, like Accessibility.getPartialAXTree). Handles are fetched in batches and released afterwards.

      Type Parameters

      • T

      Parameters

      • refs: readonly string[]
      • use: (objectIds: (string | undefined)[]) => Promise<T>

      Returns Promise<T>