electron-agent-bridge
    Preparing search index...

    Records what users do in the app's pages (protocol 1.1, record.*): while on, a CDP binding in the agent's world receives each click, field change and command key, with a locator that outlives refs; it exists from every new document's start, so navigations lose nothing. Actions an agent runs are added from their results instead (noteAgentRun), and whatever the page reports while an action runs is dropped: that input was the agent's, not a user's.

    Index
    • Add the actions an agent ran, with each element's ref replaced by its most stable locator (asked of the page, which still knows the element). Steps that failed are left out.

      Parameters

      • targetId: string
      • client: PageAgentClient
      • actions: readonly (
            | {
                button?: "left"
                | "right"
                | "middle";
                clickCount?: number;
                locator: {
                    css?: string;
                    exact?: boolean;
                    name?: string;
                    nth?: number;
                    ref?: string;
                    role?: string;
                    text?: string;
                };
                modifiers?: ("Alt" | "Control" | "Meta" | "Shift")[];
                type: "click";
            }
            | {
                locator: {
                    css?: string;
                    exact?: boolean;
                    name?: string;
                    nth?: number;
                    ref?: string;
                    role?: string;
                    text?: string;
                };
                type: "hover";
            }
            | {
                locator: {
                    css?: string;
                    exact?: boolean;
                    name?: string;
                    nth?: number;
                    ref?: string;
                    role?: string;
                    text?: string;
                };
                type: "fill";
                value: string;
            }
            | {
                fields: {
                    locator: {
                        css?: string;
                        exact?: boolean;
                        name?: string;
                        nth?: number;
                        ref?: string;
                        role?: string;
                        text?: string;
                    };
                    value: string
                    | boolean
                    | string[];
                }[];
                type: "fillForm";
            }
            | {
                locator?: {
                    css?: string;
                    exact?: boolean;
                    name?: string;
                    nth?: number;
                    ref?: string;
                    role?: string;
                    text?: string;
                };
                text: string;
                type: "type";
            }
            | {
                key: string;
                locator?: {
                    css?: string;
                    exact?: boolean;
                    name?: string;
                    nth?: number;
                    ref?: string;
                    role?: string;
                    text?: string;
                };
                type: "press";
            }
            | {
                locator: {
                    css?: string;
                    exact?: boolean;
                    name?: string;
                    nth?: number;
                    ref?: string;
                    role?: string;
                    text?: string;
                };
                type: "check";
            }
            | {
                locator: {
                    css?: string;
                    exact?: boolean;
                    name?: string;
                    nth?: number;
                    ref?: string;
                    role?: string;
                    text?: string;
                };
                type: "uncheck";
            }
            | {
                locator: {
                    css?: string;
                    exact?: boolean;
                    name?: string;
                    nth?: number;
                    ref?: string;
                    role?: string;
                    text?: string;
                };
                type: "select";
                values: string[];
            }
            | {
                deltaX?: number;
                deltaY?: number;
                locator?: {
                    css?: string;
                    exact?: boolean;
                    name?: string;
                    nth?: number;
                    ref?: string;
                    role?: string;
                    text?: string;
                };
                type: "scroll";
            }
            | {
                files: string[];
                locator: {
                    css?: string;
                    exact?: boolean;
                    name?: string;
                    nth?: number;
                    ref?: string;
                    role?: string;
                    text?: string;
                };
                type: "upload";
            }
            | {
                from: {
                    css?: string;
                    exact?: boolean;
                    name?: string;
                    nth?: number;
                    ref?: string;
                    role?: string;
                    text?: string;
                };
                to: {
                    css?: string;
                    exact?: boolean;
                    name?: string;
                    nth?: number;
                    ref?: string;
                    role?: string;
                    text?: string;
                };
                type: "drag";
            }
        )[]
      • results: readonly {
            error?: { code: string; hint?: string; message: string };
            ok: boolean;
            resolved?: { name: string; ref: string; role: string }[];
            timings: { actionMs: number; settleMs: number };
            type: string;
        }[]

      Returns Promise<void>

    • Actions pages reported within range that could not be recorded (over the size limits, malformed).

      Parameters

      • range: PageRange

      Returns number