If you’ve ever used Xcode to debug an application, Web Inspector supports many of the same features, including setting breakpoints.
Breakpoints can either be enabled or disabled . Ideally, your breakpoint will always be enabled , but there are a few reasons why they would be disabled :
- you’ve manually disabled the breakpoint. 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 or in the gutter of any text editor will toggle between enabled and disabled .
<script>line, it will be permanently 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 breakpoint. These “toggles” are also present in the context menu when right-clicking on the related resource and will apply to all breakpoints set in that resource.
http://a.com/index.js wouldn’t be shown when inspecting
- enabled (breakpoints globally enabled)
- disabled (breakpoints globally enabled)
- enabled (breakpoints globally disabled)
- disabled (breakpoints globally disabled)
Now you may be wondering what’s an Action. There are four different types:
This is basically a “shortcut” for logging values using
this), or to changes in an entire expression (e.g.
this.foo === "bar").
debuggerstatement is executed if it’s enabled.
- The Uncaught Exceptions breakpoint is similar to the All Exceptions breakpoint, except that it will only pause if the thrown exception is not caught.
- This breakpoint is essentially a “subset” of the All Exceptions breakpoint, and is therefore disabled whenever the All Exceptions breakpoint is enabled.
queueMicrotaskor used as part of a
The breakpoints above are special in the sense that they are global, non-configurable, and cannot be deleted/removed, only disabled.
The Assertion Failures and All Microtasks breakpoints are exceptions to the above, however, in that they can be deleted/removed. If you’ve deleted either of them and want to add them back, doing so is as simple as clicking the in the top-right of the Breakpoints section in the navigation sidebar in the Sources Tab.