Last active
August 10, 2018 20:54
-
-
Save pegasuspect/f1a2b898af1194af388a to your computer and use it in GitHub Desktop.
Paste it to developer console and click on any element.
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
var eventsToBeDebuggedSeperatedBySpaces = 'focus'; | |
$('*').each(function(){ | |
var eventHandler = function(event) { | |
var el = $(event.currentTarget).clone(); | |
var str = $("<div>").append(el).html(); | |
str = str.substring(0, str.indexOf(el.html())) | |
console.log(str.trim().length == 0 ? this.tagName : str.substr(0, 120)); | |
}.bind(this); | |
this.addEventListener(eventsToBeDebuggedSeperatedBySpaces, eventHandler, true); | |
this.addEventListener(eventsToBeDebuggedSeperatedBySpaces, eventHandler, false); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment