Chrome DevTools: List Registered Event Listeners

Posted About 2 years ago. Visible to the public.

In Chrome DevTools you can use getEventListeners(object) to get a list of registered event listeners on the specified object.

You can also do this without the console, by selecting an element in the DOM inspector. In the element details, select the tab Event Listeners".

Example

const registry = getEventListeners(document)

registry['up-click']
// 0: { useCapture: false, passive: false, once: false, type: 'up:click', listener: ƒ }
// 1: { useCapture: false, passive: false, once: false, type: 'up:click', listener: ƒ }
// ...
// length: n
Julian
Last edit
About 2 years ago
Henning Koch
License
Source code in this card is licensed under the MIT License.
Posted by Julian to makandra dev (2022-03-14 10:14)