Is there a way to tell the Chrome debugger (or maybe Firebug?) to not break within certain files? To assume they're not broken, essentially? This seems like something they might build in.
有没有办法告诉Chrome调试器(或者Firebug?)在某些文件中没有中断?假设他们没有被打破,基本上?这似乎是他们可能构建的东西。
6 个解决方案
#1
28
Blackboxing JS files is now possible in Firefox https://developer.mozilla.org/en-US/docs/Tools/Debugger
现在可以在Firefox中使用Blackboxing JS文件https://developer.mozilla.org/en-US/docs/Tools/Debugger
And in Chrome Canary using Experimental Dev tools. http://www.divshot.com/blog/tips-and-tricks/ignoring-library-code-while-debugging-in-chrome/
而在使用Experimental Dev工具的Chrome Canary中。 http://www.divshot.com/blog/tips-and-tricks/ignoring-library-code-while-debugging-in-chrome/
Above works in stable Chrome build as well now.
以上版本也适用于稳定的Chrome版本。
#2
18
The latest version of Chrome has implemented a new blackbox feature that does exactly what you are looking for. Basically, when you set the blackbox option on a given file, it will prevent Chrome debugger from breaking into that file.
最新版本的Chrome实施了一项新的黑匣子功能,可以完全满足您的需求。基本上,当您在给定文件上设置blackbox选项时,它将阻止Chrome调试器进入该文件。
This feature is built-in and it can be set with the context menu of the file (right click). It will also work if Chrome debugger is set for stopping on all exceptions.
此功能是内置的,可以使用文件的上下文菜单进行设置(右键单击)。如果Chrome调试器设置为停止所有异常,它也会起作用。
#3
15
If the issue you're having is that the Chrome debugger is stopping on all exceptions, even the ones inside of jQuery, then you may need to tell Chrome to only pause on uncaught exceptions, not all exceptions. When in the Script panel in the debugger, there is an icon in the lower left corner of the window that controls this.
如果你遇到的问题是Chrome调试器停止了所有异常,甚至是jQuery内部的异常,那么你可能需要告诉Chrome只停留未捕获的异常,而不是所有异常。在调试器的“脚本”面板中,窗口左下角有一个图标来控制它。
#4
3
- Go to developer tools setting and click on Balckboxing tab on the left panel.
- 转到开发人员工具设置,然后单击左侧面板上的Balckboxing选项卡。
- Then click on the Add pattern button and type jquery.js
- 然后单击Add pattern按钮并输入jquery.js
- Close and reopen developer tools, now its skipped!
- 关闭并重新打开开发人员工具,现在已跳过!
#5
#6
2
If the debugger is blowing up somewhere in the jQuery files, you could potentially wrap the suspect calls in a try/catch and then throw an error in your own catch
. That way, you can isolate exactly where your're going wrong.
如果调试器在jQuery文件中某处爆炸,您可能会将可疑调用包装在try / catch中,然后在您自己的catch中抛出错误。这样,您就可以准确地隔离出错的地方。
I would be more inclined to do stack traces to see why my code is blowing up, e.g. invalid JSON, than to try gloss over it.
我更倾向于使用堆栈跟踪来查看为什么我的代码会爆炸,例如无效的JSON,而不是试图掩饰它。
#1
28
Blackboxing JS files is now possible in Firefox https://developer.mozilla.org/en-US/docs/Tools/Debugger
现在可以在Firefox中使用Blackboxing JS文件https://developer.mozilla.org/en-US/docs/Tools/Debugger
And in Chrome Canary using Experimental Dev tools. http://www.divshot.com/blog/tips-and-tricks/ignoring-library-code-while-debugging-in-chrome/
而在使用Experimental Dev工具的Chrome Canary中。 http://www.divshot.com/blog/tips-and-tricks/ignoring-library-code-while-debugging-in-chrome/
Above works in stable Chrome build as well now.
以上版本也适用于稳定的Chrome版本。
#2
18
The latest version of Chrome has implemented a new blackbox feature that does exactly what you are looking for. Basically, when you set the blackbox option on a given file, it will prevent Chrome debugger from breaking into that file.
最新版本的Chrome实施了一项新的黑匣子功能,可以完全满足您的需求。基本上,当您在给定文件上设置blackbox选项时,它将阻止Chrome调试器进入该文件。
This feature is built-in and it can be set with the context menu of the file (right click). It will also work if Chrome debugger is set for stopping on all exceptions.
此功能是内置的,可以使用文件的上下文菜单进行设置(右键单击)。如果Chrome调试器设置为停止所有异常,它也会起作用。
#3
15
If the issue you're having is that the Chrome debugger is stopping on all exceptions, even the ones inside of jQuery, then you may need to tell Chrome to only pause on uncaught exceptions, not all exceptions. When in the Script panel in the debugger, there is an icon in the lower left corner of the window that controls this.
如果你遇到的问题是Chrome调试器停止了所有异常,甚至是jQuery内部的异常,那么你可能需要告诉Chrome只停留未捕获的异常,而不是所有异常。在调试器的“脚本”面板中,窗口左下角有一个图标来控制它。
#4
3
- Go to developer tools setting and click on Balckboxing tab on the left panel.
- 转到开发人员工具设置,然后单击左侧面板上的Balckboxing选项卡。
- Then click on the Add pattern button and type jquery.js
- 然后单击Add pattern按钮并输入jquery.js
- Close and reopen developer tools, now its skipped!
- 关闭并重新打开开发人员工具,现在已跳过!
#5
3
In Chrome, open Developer Tools, then goto Settings, and you will see the Blackbox tab:
在Chrome中,打开“开发者工具”,然后转到“设置”,您将看到“黑盒子”选项卡:
In FireFox it's even easier, just click the Eye at the bottom of the file:
在FireFox中,它更容易,只需单击文件底部的Eye:
#6
2
If the debugger is blowing up somewhere in the jQuery files, you could potentially wrap the suspect calls in a try/catch and then throw an error in your own catch
. That way, you can isolate exactly where your're going wrong.
如果调试器在jQuery文件中某处爆炸,您可能会将可疑调用包装在try / catch中,然后在您自己的catch中抛出错误。这样,您就可以准确地隔离出错的地方。
I would be more inclined to do stack traces to see why my code is blowing up, e.g. invalid JSON, than to try gloss over it.
我更倾向于使用堆栈跟踪来查看为什么我的代码会爆炸,例如无效的JSON,而不是试图掩饰它。