← Back to Debugger domain
Debugger.setBreakpointByUrl
Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this
command is issued, all existing parsed scripts will have breakpoints resolved and returned in
`locations` property. Further matching script parsing will result in subsequent
`breakpointResolved` events issued. This logical breakpoint will survive page reloads.
Domain: Debugger
stable
Parameters
| Name | Type | Description |
lineNumber | integer | Line number to set breakpoint at. |
url (optional) | string | URL of the resources to set breakpoint on. |
urlRegex (optional) | string | Regex pattern for the URLs of the resources to set breakpoints on. Either `url` or
`urlRegex` must be specified. |
scriptHash (optional) | string | Script hash of the resources to set breakpoint on. |
columnNumber (optional) | integer | Offset in the line to set breakpoint at. |
condition (optional) | string | Expression to use as a breakpoint condition. When specified, debugger will only stop on the
breakpoint if this expression evaluates to true. |
Returns
| Name | Type | Description |
breakpointId | BreakpointId | Id of the created breakpoint for further reference. |
locations | array | List of the locations this breakpoint resolved into upon addition. |
Example Request
{
"id": 1,
"method": "Debugger.setBreakpointByUrl",
"params": {
"lineNumber": 0
}
}
Example Response
{
"id": 1,
"result": {
"breakpointId": "breakpointId-value",
"locations": []
}
}
Usage in Node.js
const result = await send('Debugger.setBreakpointByUrl', {"lineNumber": 0});
console.log(result);
// {"breakpointId": "breakpointId-value", "locations": []}