How to get a list of element's event listeners using vanilla JS in 2019

Viewed 824

There are several other topics looking for the same thing here on Stack Overflow, though none has an answer and most are very, very old.

So, we're a few days from 2019 now, we have ES6 and browsers came a long way. Do we now finally have a solution for that?

Notes:

  • No jQuery (no $__data), the solution must work with events bound using addEventListener directly
  • No devtools solutions no Chrome plugins, no getEventListeners() in console. Standard coding.
  • No "hacking" addEventListener() to register calls.

Is that wishful thinking or browsers finally provide us this info in modern days?

0 Answers
Related