Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save chrisribe/b3e4a6a2058fda066b3cc1e90865e27f to your computer and use it in GitHub Desktop.
Save chrisribe/b3e4a6a2058fda066b3cc1e90865e27f to your computer and use it in GitHub Desktop.
//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