You can overwrite alert, and create an Error for the stack trace:
var old = alert;
alert = function() {
console.log(new Error().stack);
old.apply(window, arguments);
};
You can overwrite alert, and create an Error for the stack trace:
var old = alert;
alert = function() {
console.log(new Error().stack);
old.apply(window, arguments);
};