In my Javascript code I have this
function log_function() {
console.log("WHO FIRED ME");
}
window.alert = log_function;
window.open = log_function;
window.confirm = log_function;
Inside the function log_function I would like to know "who" fired the "log_function". Is it possible? I will assign that function to many more functions, so I would like to know who fired the log_function.
For example, if inside a page there is a script like:
alert("aaa");
I would like to know that it was the "alert" who was blocked and log it in the console.