How to get firebug to break on exception?

懵懂的女人 提交于 2019-12-01 02:43:16

Install Firebug 1.6b1 http://getfirebug.com/releases/firebug/1.6X, Firebug > Console > "the exception" Click the breakpoint selector in the left column. Run your code. Firebug breaks on that line.

Or Firebug > Console > [||] breaks on next error

The respondent was helpful but neglected something very key I was missing; the window.onerror event. Here is the full code:

 window.onerror = function(msg) {
   debugger;
 }

Call Web Developer Debugger (Tools => Web Developer => Debugger or Ctrl + Shift + S), click gear icon and check "Pause on exception":

Or execute debugger; in Web Developer Console!

Official Web Developer Debugger docs: https://developer.mozilla.org/en-US/docs/Tools/Debugger

Put a debugger; statement in your code or use the Script tab of firebug to click on a line number (which inserts a breakpoint).

If you only want to do it when you throw an exception, you could put the debugger statement in a catch block.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!