Wirebrowser Automation Script API Referece
    Preparing search index...

    Interface LeaveHookContext

    interface LeaveHookContext {
        functionSource?: string;
        phase: "leave";
        returnValue: HookReturnValue;
        stackTrace: HookStackFrame[];
        variables: string[];
        eval(expression: string): void;
        followReturn(): void;
        log(message: string): void;
        return(value: any): void;
        returnExpr(expression: string): void;
        send(message: any): void;
        setVariable(name: string, value: any): void;
        stepInto(): void;
        stepIntoAsync(): void;
        stepOut(): void;
        stepOver(): void;
    }

    Hierarchy (View Summary)

    Index

    Properties

    functionSource?: string
    phase: "leave"
    returnValue: HookReturnValue

    Current return value metadata. For non-promise values, value may be populated. For promises, isPromise may be true and objectId may be present.

    stackTrace: HookStackFrame[]
    variables: string[]

    Variables in 'local', 'closure' or 'catch' scope. These are the variables that can be modified with ctx.setVariable

    Methods

    • Schedules an expression to be evaluated in the current call frame.

      The result is exposed later as result.evalResult in handleResult.

      This runs with full access to the frame scope and this. Execution is deferred and the result is not available immediately.

      Use inline JavaScript for immediate evaluation.

      Parameters

      • expression: string

      Returns void

    • Requests continuation tracking after this leave point. If the runtime can correlate the continuation, onReturnFollowed will be invoked later.

      Returns void

    • Collects log messages that are displayed on the Node-side once the handler execution is completed.

      Parameters

      • message: string

      Returns void

    • Overrides the return value using a JSON-serializable value.

      Parameters

      • value: any

      Returns void

    • Overrides the return value using a raw expression string.

      Parameters

      • expression: string

      Returns void

    • Sends a structured message to the Node-side result handler. Collected into result.messages.

      Parameters

      • message: any

      Returns void

    • Schedules a write to a variable binding in the current call frame using debugger semantics.

      The variable is resolved by walking the scope chain (CDP order) and selecting the first match in a supported scope (local, closure, catch).

      This is NOT a normal JavaScript assignment:

      • execution is deferred (applied after the handler returns)
      • it bypasses JS semantics (e.g. can modify const)

      If the first match is in an unsupported scope (e.g. block), the operation fails.

      Use inline JavaScript for immediate, standard behavior.

      Parameters

      • name: string
      • value: any

      Returns void

    • Requests continuation into the next function call. If the runtime can correlate the continuation, onStep will be invoked later.

      Returns void

    • Requests stepping into the next asynchronous continuation. If the runtime can correlate the continuation, onStep will be invoked later.

      Returns void

    • Requests stepping out of the current function.

      If the runtime can correlate the continuation, onStep will be invoked later.

      Returns void