After reading the insights from the overriding-alert topic, I successfully replaced all alerts:
window.alert = function() {
// retrieve text
console.log(this);
};
Is there a method to access the original alert text that was replaced with my custom function? When using this
, it only displays the window
object.