I’m trying to use the pause feature of the javascript debugger in Chrome. The problem is that whenever I move the mouse over the page, the onMouseMove function is called and the script pauses at that point. Is there any way to ignore this function so that the script pauses when I invoke the function I want to debug?
I have run into this problem several times, and it would be really helpful as it is sometimes not at all obvious what function I need to look at. One part solution I have found is Visual Event, but this has it’s limitations – last I checked it doesn’t let you debug the functions, but it helps you work out what’s going on.
I mentioned that I use chrome, but a solution in any browser or debugger would be good.
Google Chrome debugger has a section called ‘Event Listener Breakpoints’ under ‘Scripts’ tab. It allows you to pause JavaScript execution on specific type of event, such as mouse click, and ignore all other types of events.
See Chrome Developer Tools: Breakpoints, section ‘Breakpoints on JavaScript Event Listeners’.
You can also see the list of all event listeners attached to a specific element. Open ‘Event Listeners’ section under ‘Elements’ tab.