← Back to Debugger domain

Debugger.setBreakpoint

Sets JavaScript breakpoint at a given location.

Domain: Debugger stable

Parameters

NameTypeDescription
locationLocationLocation to set breakpoint in.
condition (optional)stringExpression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true.

Returns

NameTypeDescription
breakpointIdBreakpointIdId of the created breakpoint for further reference.
actualLocationLocationLocation this breakpoint resolved into.

Example Request

{
  "id": 1,
  "method": "Debugger.setBreakpoint",
  "params": {
    "location": "location-value"
  }
}

Example Response

{
  "id": 1,
  "result": {
    "breakpointId": "breakpointId-value",
    "actualLocation": "actualLocation-value"
  }
}

Usage in Node.js

const result = await send('Debugger.setBreakpoint', {"location": "location-value"});
console.log(result);
// {"breakpointId": "breakpointId-value", "actualLocation": "actualLocation-value"}