Last active
August 19, 2022 20:28
-
-
Save chrisribe/b3e4a6a2058fda066b3cc1e90865e27f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
//Events to break on. | |
var aEvents = [ | |
'click', | |
'touchstart' | |
]; | |
function breakNow(e) { | |
console.log(`break now 4 event: ${e.type}`, e); | |
console.log("STACK is:", stackTrace()); | |
debugger; | |
} | |
function stackTrace() { | |
var err = new Error(); | |
return err.stack; | |
} | |
aEvents.forEach(function(eventName) { | |
console.log(`addEventListener for: [${eventName}]`); | |
window.document.body.addEventListener(eventName, breakNow); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment