spraff
spraff

Reputation: 33385

Chrome/Firefox make event listener breakpoints skip out of jQuery and other libraries before halting

I am debugging a third-party HTML/Javascript page.

If I set event listener breakpoints of XHR breakpoints, then the debugger siezes up as soon as this happens because the first layer of interpretation is at the level of jQuery or another large library which is too big to reasonably handle in the debugger.

I don't want to break into these libraries, they're not where the interesting code paths are.

I want execution to continue through the event handler as normal and break as soon as and only when it hits some application-level code.

Is this possible in Chrome/Firefox?

Upvotes: 2

Views: 576

Answers (1)

robertc
robertc

Reputation: 75707

If you're willing to use a pre-release version of Firefox, the built in developer tools now have a black box feature:

When a source is black boxed:

  • Any breakpoints it may have are disabled.
  • When “pause on exceptions” is enabled, the debugger won’t pause when an exception is thrown in the black boxed source; instead it will wait until (and if) the stack unwinds to a frame in a source that isn’t black boxed.
  • The debugger will skip through black boxed sources when stepping.

This feature will definitely be in Firefox Aurora, may be in Firefox Beta by now (I haven't checked).

Upvotes: 1

Related Questions