Last active
October 30, 2019 15:42
-
-
Save hayatbiralem/6fd46f678fb10bfc83ec855ac5d65a40 to your computer and use it in GitHub Desktop.
Log all events
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Detailed source: https://css-tricks.com/capturing-all-events/ | |
var oldAddEventListener = EventTarget.prototype.addEventListener; | |
var disabled = ['mousemove', 'mouseover']; | |
EventTarget.prototype.addEventListener = function(eventName, eventHandler) | |
{ | |
if(disabled.indexOf(eventName) === -1) { | |
console.log(eventName, eventHandler.toString()); | |
} | |
oldAddEventListener.apply(this, arguments); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment