How to get firebug to break on exception?

前端 未结 4 2068
后悔当初
后悔当初 2021-01-07 19:28

I\'m using Firebug 1.5.4. When I reference an undefined variable or some such, it breaks right where the problem occurs, and throws me into the debug view where I can see t

相关标签:
4条回答
  • 2021-01-07 20:08

    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

    0 讨论(0)
  • 2021-01-07 20:11

    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;
     }
    
    0 讨论(0)
  • 2021-01-07 20:14

    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.

    0 讨论(0)
  • 2021-01-07 20:17

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

    enter image description here

    Or execute debugger; in Web Developer Console!

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

    0 讨论(0)
提交回复
热议问题