I have a very complex website and I know that somewhere is an alert()
with a description. Is there a way to set a breakpoint on the alert()
call? The HTML is generated, so I cannot just grep for the message.
You can use the console to replace the alert
function:
window.alert = function() { debugger; };
Firebug's Script panel allows you to search for code throughout all your JavaScript sources.
So you can simply search for alert(
or search for the message that the alert box shows and set a breakpoint on the line where it's called.
Another way is to use the Break On Next button ( ) to stop at the next JavaScript statement that gets executed. So, click the button and then do the action that causes the alert box to be displaced.
Note: This only works if there are no other event handlers called before the event showing the alert box.
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