It is possible for javascript to get stuck in a loop of opening up alerts. For example:
for(var i=0;;i++)
alert('This will never stop');
Is there a way to gracefully stop this in firefox, without having to kill the whole process?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityIt is possible for javascript to get stuck in a loop of opening up alerts. For example:
for(var i=0;;i++)
alert('This will never stop');
Is there a way to gracefully stop this in firefox, without having to kill the whole process?
perhaps the 'NoScript' plugin could help. Ban the site and the script won't be executed at all
Stackoverflow question reference: How do you stop an infinite loop in Javascript?
A critical difference in your loop is the pop-up (user interaction) that prevents the "slow-script" detection.
If you're quick enough with it, click "Ok" then hit F5. You may have to confirm one or two more popups, but the page will reload and you'll be saved.
I usually have the Javascript popup in focus so that I can just hit Enter to get rid of it. Then, I position my mouse cursor just above the Close Tab button. I then begin a race where I hit Enter to close the popup and immediately click the Close Tab button before it has a chance to create another popup.
I'm using AlertStopper (https://addons.mozilla.org/af/firefox/addon/13530/) myself.