Is Firefox dev tools able to catch all the error?

时间:2017-08-04 13:15:25

标签: javascript firebug firefox-developer-tools

Since Firebug was discontinued I had to started using the Dev Tools.

I was debugging a page, when I was clicking a button it was not firing the event. I realized a function was not defined, the JS file reference was missing, however, the Dev Tools did not tell me about it.

Trying my old still installed Firebug it threw something like "ReferenceError: foo function is not defined".

Do I need to enable any options more for Dev Tools? or isn't Dev Tools able to catch all the errors?

UPDATE

Test case

 <script type="text/javascript">
              function DoSomething(e){
                     e.preventDefault();
                     foo();
              }
 </script>

<a href="www.google.com" onclick="DoSomething(event)">Click me!</a>

1 个答案:

答案 0 :(得分:1)

您需要确保在控制台面板中启用了“JS”过滤器。

如果这对查看错误没有帮助,您可以尝试新的控制台前端。在版本55之前的Firefox中,可以通过转到about:config并将首选项devtools.webconsole.new-frontend-enabled设置为true来启用此功能。在新的UI中,确保启用过滤器“错误”和“警告”。

如果您仍然看不到记录的错误,那么它可能是DevTools中的一个错误。在这种情况下,您应该尝试是否可以在new Firefox profile中重现问题。如果您还可以在新配置文件中重现它,则应该report the bug(如果还没有,bug 755553似乎相关)并且要么将网址配置到发生错误的网页,或者附上一个简化的测试用例。