I am rewriting this question because I think it deserves to be answered. The reason given for why it was closed is as follows: "Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself."
The specific problem: When calling too many alerts/confirms in JavaScript (as might happen from a bug in your code), the browser will eventually ask you if you want to ignore further alerts. Once you ignore these alerts, how do you get the browser to re-enable those alerts?
Valid code to reproduce the problem:
<script>while(true) alert("Stop Me");</script>
I'll go on to answer the question if it's re-opened...
Here is Zane's original question:
When developing in javascript, I sometimes will end up in a situation where I generate alerts in an endless loop. Silly but true.
To get out of this endless loop, I either need to close the browser (normally using chrome) or disable dialogs for the page. But I don't know how to re-enable dialogs without restarting browser.
Is there a simple way to re-enable the dialogs? Surprisingly, I didn't get anything useful when googling for it.
Zane
Close tab > Ctrl+Shift+T (reopen last closed tab)
Works every time.
Let me present an alternative answer from what you're asking, as I think alerts()
are a rather time consuming way to debug, especially when you're using Chrome as your development platform.
Developing with the aid of various console functions you can get a more streamlined debugging workflow set into place.
I understand that alerts()
are sometimes good to stop the execution to read your code - although console has commands to cater for this as well:
for( var x = 0; x < 10; x++ ) {
if ( x == 5 )
debugger; //Console opens, press F8 to resume or F10 to step into.
}
for( var y = 10; y > 0; y-- ) {
if ( y == 4 )
console.warn( 'Oh no!', y );
else
console.log( 'Normal:', y );
}
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