Add conditions to JavaScript breakpoints
By adding conditions to JavaScript breakpoints in the Debugger tab, you can limit breaks to specific kinds of executions.
In the Debugger tab, Control-click a blue breakpoint marker (in main content pane or in the left sidebar), then choose Edit Breakpoint from the shortcut menu.
In the dialog that appears, do any of the following:
Checkbox: Click the checkbox to turn the breakpoint on or off.
Condition: To set whether further breakpoints should be evaluated, enter a JavaScript expression in the Condition field. The JavaScript expression is evaluated in the scope where the breakpoint is hit. If it evaluates to true, then the breakpoint pauses execution; otherwise execution continues without evaluating further actions.
Ignore: Enter a number in this field to skip further processing of this breakpoint’s actions for a fixed number of times.
Actions: Choose an action to be performed at the breakpoint (subject to the Condition and Ignore fields). To add multiple actions, click the Add button (+). To remove an existing action, click its Remove button (–). Actions are evaluated in the order that they are listed. There are four actions:
Log Message: Logs the specified message to the console. You can use template literal syntax to interpolate expressions into the log message. Expressions are evaluated in the scope of where the debugger has paused.
Evaluate JavaScript: Evaluates the expression in the scope of where the debugger has paused. Syntax errors, exceptions, and breakpoints are ignored while evaluating JavaScript in a breakpoint action or condition.
Play Sound: Causes the system beep to play.
Probe Expression: Evaluates the JavaScript expression as above, but adds the evaluation result to the Probes detail sidebar under a section for the breakpoint's source location. It is a way to observe state changes in an interactive program, like a game, without being interrupted by the debugger or sifting through console output.