setBreakpointByUrl method

Future<SetBreakpointByUrlResult> setBreakpointByUrl(
  1. int lineNumber, {
  2. String? url,
  3. String? urlRegex,
  4. String? scriptHash,
  5. int? columnNumber,
  6. String? condition,
})

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. lineNumber Line number to set breakpoint at. url URL of the resources to set breakpoint on. urlRegex Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified. scriptHash Script hash of the resources to set breakpoint on. columnNumber Offset in the line to set breakpoint at. condition Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true.

Implementation

Future<SetBreakpointByUrlResult> setBreakpointByUrl(
  int lineNumber, {
  String? url,
  String? urlRegex,
  String? scriptHash,
  int? columnNumber,
  String? condition,
}) async {
  var result = await _client.send('Debugger.setBreakpointByUrl', {
    'lineNumber': lineNumber,
    if (url != null) 'url': url,
    if (urlRegex != null) 'urlRegex': urlRegex,
    if (scriptHash != null) 'scriptHash': scriptHash,
    if (columnNumber != null) 'columnNumber': columnNumber,
    if (condition != null) 'condition': condition,
  });
  return SetBreakpointByUrlResult.fromJson(result);
}