Évitez de marcher à travers le fichier javascript Outils pour les développeurs Chrome?
-
27-10-2019 - |
Question
Je me demande, est-il possible d'omettre un fichier javascript du débogueur Developer Tools Chrome, il sautera automatiquement des appels de fonction effectués à ce script?
Je demande parce que mes projets comprennent souvent de grandes bibliothèques telles que jQuery. Lorsque je fais un pas par javascript Outils de développement Chrome pendant le débogage, je dois pas dans la lib jQuery à chaque fois que je fais un appel jQuery dans mon script.
Je finissent par avoir à fixer une ligne des points d'arrêt après chaque appel à l'objet jQuery. C'est la seule façon que j'ai trouvé sauter passé et il est très ennuyeux.
La solution
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+.
- Enable "Enable Developer Tools experiments" from
chrome://flags/#enable-devtools-experiments
. (Yes, you need to type that where you type the URL) - Relaunch chrome
- Click on settings icon in Chrome Developer Tools
- Go to Experiments section. Notice the WARNING ;) and then tick
Enable frameworks debugging support
. (You also might want to tryShow step-in candidates while debugging
) - Now, close Chrome Dev Tools and again open it.
- Click on settings icon in Chrome Developer Tools
- 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
Autres conseils
iSid I would like to point out that as of Chrome 38 you no longer need to enable the devtools experiments. Instead if you go straight to the F12 developer tools -> settings -> general -> sources you will see the last item in there is manage framework blackboxing. The good part is you can setup each framework on it's own line or you can throw together a generic catch all pattern like (firebug|angular|knockout|jquery|bootstrap|modernizr|respond)
Under Chrome v68, while debugging on a .js file, use left click to blackbox script:
The "Step Out" button can be used to quickly get you out of the JQuery code.