Enable JavaScript Dialog

I am rewriting this question because I think it deserves an answer. The reason why it was closed is this: "Questions related to problems with the written code should describe the specific problem - and include valid code to reproduce it - in the question itself."

Specific problem: if too many warnings / confirmations are triggered in JavaScript (as this may happen due to an error in the code), the browser will eventually ask you if you want to ignore further notifications. Once you ignore these warnings, how can you make the browser re-enable these warnings?

Valid code to reproduce the problem:

<script>while(true) alert("Stop Me");</script> 

I will continue to answer the question if it opens again ...

Here is Zane’s original question:

When developing in javascript, I sometimes find myself in a situation where I generate warnings in an endless loop. Stupid but true.

To exit this endless loop, I need to close the browser (usually using chrome) or turn off the dialogs for the page. But I do not know how to reactivate dialogs without restarting the browser.

Is there an easy way to re-enable dialogs? Surprisingly, I did not get anything useful when I was looking for it.

Zane

+6
source share
2 answers

Close tab> Ctrl + Shift + T (open a newly closed tab)

It works every time. :)

+8
source

Let me introduce an alternative answer from what you are asking, since I think alerts() is a rather time-consuming way to debug, especially when you use Chrome as a development platform.

Development using various console functions allows you to set up a more streamlined debugging workflow.

I understand that alerts() sometimes good to stop execution, to read your code, although the console has commands for this:

debugger

 for( var x = 0; x < 10; x++ ) { if ( x == 5 ) debugger; //Console opens, press F8 to resume or F10 to step into. } 

enter image description here

Console.warn and Console.log

  for( var y = 10; y > 0; y-- ) { if ( y == 4 ) console.warn( 'Oh no!', y ); else console.log( 'Normal:', y ); } 

enter image description here

+4
source

Source: https://habr.com/ru/post/958146/


All Articles