5

I am trying to debug a third-party HTML/Javascript page but I can't easily locate the script entry points to set breakpoints on them.

I want the debugger to break on any element's onclick event handler. At the moment if the page is set up with something like

document.getElementById("foo").onclick = bar;

then in general it isn't easy to determine that foo and bar are connected.

So, I want to break on all onclicks, wherever they may be.

Can I do this in Chrome or Firefox?

spraff
  • 32,570
  • 22
  • 121
  • 229

1 Answers1

14

Chrome:

Chrome inspector -> sources -> Event Listener Breakpoints

Firefox: get EventBug

You can read a bit more about eventBug in here: Using Firefox, how can I monitor all JavaScript events that are fired?

Community
  • 1
  • 1
Adam Zielinski
  • 2,774
  • 1
  • 25
  • 36