6

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?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Danigoodw
  • 379
  • 3
  • 10
  • To my knowledge, we still don't have a native way to achieve this, of course there's libraries and frameworks that'll manage this stuff for you, but natively... I personally don't actually know, so I'll be interested to find out myself... – JO3-W3B-D3V Dec 19 '18 at 12:23
  • 1
    If anything like it were possible, we'd probably have seen it on a new answer on an old question by now – CertainPerformance Dec 19 '18 at 12:29
  • "*No "hacking" `addEventListener()` to register calls*" - unfortunately I think that's still the only way. – David Thomas Dec 19 '18 at 12:32
  • I guess you went through https://stackoverflow.com/questions/9046741/get-event-listeners-attached-to-node-using-addeventlistener – Sergiu Paraschiv Dec 19 '18 at 12:54

0 Answers0