Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding function catching key event in Javascript?

I'm writing a user script for a complex web app. The existing code is catching the 'j' and 'k' keydown events.

I'd like to be able to find this function to see what it's doing. Is there a way to list all the key event handlers in a document? Or maybe a way to set a breakpoint somehow in Chrome Developer Tools for when I press the letter?

like image 770
huyz Avatar asked Oct 27 '25 05:10

huyz


1 Answers

Yes, in the developer tools, go to the Scripts tab, select the page, go to Event Listener Breakpoints, Keyboard, keydown.

enter image description here

Though this might not necessarily help you much, e.g. if the script is minified or they use a library. But you can give it a try.

like image 132
Felix Kling Avatar answered Oct 29 '25 19:10

Felix Kling



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!