← Back to Debugger domain

Debugger.evaluateOnCallFrame

Evaluates expression on a given call frame.

Domain: Debugger stable

Parameters

NameTypeDescription
callFrameIdCallFrameIdCall frame identifier to evaluate on.
expressionstringExpression to evaluate.
objectGroup (optional)stringString object group name to put result into (allows rapid releasing resulting object handles using `releaseObjectGroup`).
includeCommandLineAPI (optional)booleanSpecifies whether command line API should be available to the evaluated expression, defaults to false.
silent (optional)booleanIn silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides `setPauseOnException` state.
returnByValue (optional)booleanWhether the result is expected to be a JSON object that should be sent by value.
generatePreview (optional)booleanWhether preview should be generated for the result.
throwOnSideEffect (optional)booleanWhether to throw an exception if side effect cannot be ruled out during evaluation.
timeout (optional)Runtime.TimeDeltaTerminate execution after timing out (number of milliseconds).

Returns

NameTypeDescription
resultRuntime.RemoteObjectObject wrapper for the evaluation result.
exceptionDetailsRuntime.ExceptionDetailsException details.

Example Request

{
  "id": 1,
  "method": "Debugger.evaluateOnCallFrame",
  "params": {
    "callFrameId": "0",
    "expression": "document.title"
  }
}

Example Response

{
  "id": 1,
  "result": {
    "result": {
      "type": "string",
      "value": "Example Domain"
    },
    "exceptionDetails": "exceptionDetails-value"
  }
}

Usage in Node.js

const result = await send('Debugger.evaluateOnCallFrame', {"callFrameId": "0", "expression": "document.title"});
console.log(result);
// {"result": {"type": "string", "value": "Example Domain"}, "exceptionDetails": "exceptionDetails-value"}