Step through code - Firefox Developer Tools 编辑

When the debugger is stopped at a breakpoint, you can step through it using four buttons in the toolbar:

In order, the buttons are:

  • Play: run to the next breakpoint
  • Step over: advance to the next line in the same function.
  • Step in: advance to the next line in the function, unless on a function call, in which case enter the function being called
  • Step out: run to the end of the current function, in which case, the debugger will skip the return value from a function, returning execution to the caller

Split console

When paused, you can press the Esc key to open and close the split console to gain more insight into errors and variables:

Pause on breakpoints overlay

Since Firefox 70, when your code is paused on a breakpoint an overlay appears on the viewport of the tab you are debugging.

This lets you know what kind of breakpoint the code is paused on (breakpoint, event breakpoint, etc.), and also provides a step button and a play button. The thinking here is that if you've got your DevTools open in a separate window, as many people do, it can be easier to have the buttons available right there to move the code forward while you are looking at the result.

If you want to turn this feature off, since Firefox 71 you can do so by going to about:config in a new tab, setting the devtools.debugger.features.overlay pref to false, and restarting the browser.

Inline variable preview

New in Firefox 71, the source pane now gives you an instant preview of the variables on each line of code you've stepped through. See Set a breakpoint > Inline variable preview for more information.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:89 次

字数:3023

最后编辑:6 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文