Web Inspector ReferenceURL Breakpoints
URL Breakpoints can be added by selecting URL Breakpoint… after clicking on the [Create Breakpoint] in the top-right of the Breakpoints section in the Navigation Sidebar in the Sources Tab.
All URL Breakpoints are preserved across Web Inspector sessions.
URL Breakpoints have two different types: Containing and Matching.
In addition to Containing and Matching URL Breakpoints, there is also a special URL Breakpoint: All Requests.
The All Requests URL Breakpoint can be added/enabled by selecting selecting All Requests after clicking on the [Create Breakpoint] in the top-right of the Breakpoints section in the Navigation Sidebar in the Sources Tab.
URL Breakpoints have a few different configuration options, reachable by right-clicking and selecting Edit Breakpoint… in the context menu.
Rather than execute arbitrary code, however, you may just want to ignore the first few times the URL Breakpoint is reached. If this is the case, setting the Ignore input to any positive integer will prevent the URL Breakpoint from pausing execution until it has been reached that many times.
Now you may be wondering what’s an Action. There are four different types:
This is basically a “shortcut” for logging values using
Adding one of these will cause Web Inspector to play a system beep sound whenever the URL Breakpoint is hit.
Probe Expression s can be thought of almost like a mini-Console. Each time the related URL Breakpoint is hit, the Probe Expression is evaluated and the result is saved in the Probe panel in the Details Sidebar in the Sources Tab, allowing you to see how the result of the expression changes during the lifetime of your program. You can use this to observe changes to a specific variable (e.g.
this), or to changes in an entire expression (e.g.
this.foo === "bar").
If any Action is set, you can also configure the URL Breakpoint to Automatically continue after evaluating. This will cause the URL Breakpoint to become effectively “invisible”, in that it will never pause execution. URL Breakpoints that Automatically continue after evaluating will have a small white triangle (“hollow”) in the icon:
URL Breakpoints can either be enabled or disabled . Ideally, URL Breakpoints will always be enabled , but there are a few reasons why they would be disabled :
- the URL Breakpoint was manually disabled . Clicking (or right-clicking and selecting Enable Breakpoint or Disable Breakpoint in the context menu) on any breakpoint icon in the Navigation Sidebar in the Sources Tab will toggle between enabled and disabled .
- breakpoints have been globally disabled . The global breakpoint control is a button that looks just like a breakpoint located in the top of the Navigation Sidebar in the Sources Tab.
All enable/disable/delete toggles are available in the context menu when right-clicking on any URL Breakpoint.
- enabled (breakpoints globally enabled)
- enabled (breakpoints globally enabled) with auto-continue
- disabled (breakpoints globally enabled)
- disabled (breakpoints globally enabled) with auto-continue
- enabled (breakpoints globally disabled)
- enabled (breakpoints globally disabled) with auto-continue
- disabled (breakpoints globally disabled)
- disabled (breakpoints globally disabled) with auto-continue