DevTools Tips

Ignore JavaScript code to ease debugging

Categories: Supported by:

Debugging JavaScript can quickly get out of hand when you have a lot of code and many functions that call each other.

What's even worse is when a lot of this code isn't even yours. This can happen when you use frameworks or libraries. You don't really want to debug the library code, but sometimes it gets in the way when trying to step through your own code while using breakpoints.

To help with this, you can ignore third-party scripts (like library source files) in DevTools. When ignored, those files don't appear in your callstacks when debugging, and you don't step through them anymore.

In Firefox, you can go even further than this and ignore parts of a script only. Maybe you have a utility function in your file that gets called over and over again but isn't related to what you're trying to debug.

To ignore part of script only in Firefox:

Firefox ignore line contextual menu option, displayed on a few lines of selected JavaScript code