Stopping infinite notification cycles in Mozilla

This may be a dumb question. But somehow this helped me once and after some basic research I could not find the answer.

I studied JavaScript, and the code I wrote had an error and output endless warning loops. I tried regular shortcuts like Ctrl + C and Ctrl + Z, but they didn't work. So I wondered if there was any solution for this other than terminating the browser process (for example, using Ctrl + Alt + Del).

+3
source share
4 answers

There are workarounds, as @Sarfras mentions, but not a magic button that will save you. The F5 workaround is the best I know.

+1
source
0

alert , firebug. console.debug("whatever message", whatever, values).

, , , . , , ;)

0

You can log errors without a specific browser with a global array. This method allows you to "disable" an endless alert, but you can still read the error log.

   var logErrors= true, errorLog= [];
    function Yikes(str){
     if(str.constructor==Error)str=str.message;
     errorLog.push(str);
     if(logErrors== true){
      logErrors= confirm(str+'\n keep showing errors? ');
     }
     return true;
    }
    window.onerror=Yikes;

you can also use it around the problem code to return values:

  try{
   d2= Date.fromUTCArray(D.slice(0, D.length));
  }
  catch(er){
   return Yikes(er.message+', '+D);
  }
0
source

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


All Articles