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.
Asked
Active
Viewed 3,560 times
1 Answers
3
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.)
Alexander Pavlov
- 31,598
- 5
- 67
- 93