getEventListeners utility
tl;dr: Use getEventListeners
in Chromium/Safari DevTools to get an idea of what’s being run “concurrently” and vying for resources. Note that getEventListeners
only exists in the context of DevTools.
getEventListeners(window)
{ error: Array, beforeunload: Array, load: Array, resize: Array, focusin: Array, ... }
getEventListeners(document)
{ keydown: Array, mousedown: Array, visibilitychange: Array, scroll: Array, click: Array, ... }
For example, you can use getEventListeners(window).scroll
to investigate how many scroll event handlers are listening and running upon scroll and what the bottleneck could be for a not so smooth scrolling experience.