Skip to content

Instantly share code, notes, and snippets.

@TunedMystic
Created August 10, 2019 14:20
Show Gist options
  • Save TunedMystic/5c2e87ad015be6f66c0e782201efe324 to your computer and use it in GitHub Desktop.
Save TunedMystic/5c2e87ad015be6f66c0e782201efe324 to your computer and use it in GitHub Desktop.
See all event listeners on the page.
// See all event listeners on the page.
// Ref: https://stackoverflow.com/a/45842339
//
Array.from(document.querySelectorAll('*'))
.reduce(function(pre, dom){
var evtObj = getEventListeners(dom)
Object.keys(evtObj).forEach(function (evt) {
if (typeof pre[evt] === 'undefined') {
pre[evt] = 0
}
pre[evt] += evtObj[evt].length
})
return pre
}, {})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment