For debugging purpose and memory leak, I’d like to have the full list of registered event handlers. There’s this nice visual tool but a plain text list would be welcomed.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As the mentioned link says, there is no JavaScript API to retrieve all registered listeners. So, for testing purposes you might try overriding the EventTarget.prototype.addEventListener/removeEventListener methods and storing their arguments in your own storage to inspect later.
On a similar note, you can use the Chrome Developer Tools to examine currently registered listeners for a particular node (or the node chain up to the document root) in the Elements panel (“Event Listeners” section in the sidebar.)