避免单步执行Chrome Developer Tools中的javascript文件? [英] Avoid stepping through javascript file in Chrome Developer Tools?

查看:231
本文介绍了避免单步执行Chrome Developer Tools中的javascript文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道,有没有办法从Chrome Developer Tools调试器中省略javascript文件,所以它会自动跳过对该脚本的任何函数调用?



我问,因为我的项目通常包括大型库,如jQuery。当我在调试时在Chrome Developer Tools中单步执行javascript时,每次在脚本中进行jQuery调用时,我都必须单步执行jQuery的lib。



我最终必须在每次调用jQuery对象后设置一行断点。这是我发现跳过的唯一方法,它非常烦人。

解决方案

更新2

在最新版本的chrome中,此功能的用户流程有所改善。请参阅


I am wondering, is there any way to omit a javascript file from Chrome Developer Tools debugger, so it will automatically skip over any function calls made to that script?

I ask because my projects often include large libraries such as jQuery. When I step through javascript in Chrome Developer Tools while debugging, I have to step through jQuery's lib every time I make a jQuery call in my script.

I end up having to set breakpoints one line after every call to the jQuery object. It's the only way I have found to skip past and it's very annoying.

解决方案

UPDATE 2
There has been an improvement in user flow of this feature in latest versions of chrome. Please refer to https://developer.chrome.com/devtools/docs/blackboxing

UPDATE 1
Since Chrome version 38, you no longer have to enable Developer Tools experiments.

Below details are only for history

This is possible now in chrome version 30+.

  1. Enable "Enable Developer Tools experiments" from chrome://flags/#enable-devtools-experiments. (Yes, you need to type that where you type the URL)
  2. Relaunch chrome
  3. Click on settings icon in Chrome Developer Tools
  4. Go to Experiments section. Notice the WARNING ;) and then tick Enable frameworks debugging support. (You also might want to try Show step-in candidates while debugging)
  5. Now, close Chrome Dev Tools and again open it.
  6. Click on settings icon in Chrome Developer Tools
  7. In general section you will find "Skip stepping through sources with particular names". Tick that and provide regex for the javascript file names which you want to skip stepping into.

Source: Tips and Tricks: Ignoring library code while debugging in Chrome

这篇关于避免单步执行Chrome Developer Tools中的javascript文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆