I'm just curious to know
Is there ANY ways in ANY browser to find out where the alert I get is raised from?
I tried it in chrome but there is no call stack available when alert shows.
Any idea?
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 monkeypatch the alert to do so:
//put this at the very top of your page: window.alert = function() { throw("alert called") }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With