Created
October 13, 2018 06:01
-
-
Save aswinsekar/ff7324cd4b16909cc9130652ae79ff20 to your computer and use it in GitHub Desktop.
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
// IIFE - to print the trace where alert raised from | |
// Doesn't impact the alert behavior or any other behavior of your front end | |
// Add this code in your javascript or run it in console of your browser | |
// After adding, console will have stack trace of the alert printed | |
(function(proxied) { | |
window.alert = function() { | |
console.trace(); | |
return proxied.apply(this, arguments); | |
}; | |
})(window.alert); | |
// have used proxy approach for not disturbing the alert call |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment