Infinite for loop jams the browser
Reported by
sahkoha...@gmail.com,
May 23 2017
|
|||||
Issue description
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36
Steps to reproduce the problem:
1. Open JS console on a website
2. Type in for(var i=0; i< 3;i++){ i--;}
3. Browser window or tab won't close anymore, back button doesn't work
What is the expected behavior?
Infinite for loop shouldn't make the browser unresponsive to close command. while(true){} doesn't cause this issue.
What went wrong?
for loop continues forever and the browser just waits for its completion.
Did this work before? N/A
Chrome version: 58.0.3029.110 Channel: stable
OS Version: OS X 10.12.4
Flash Version:
An advertising site might use this trick to force people to stay on their site.
,
May 23 2017
,
May 24 2017
Chrome 59 (beta, OSX) doesn't have this exact problem. Clicking close on the tab will close the tab.
Creating a page with something like
<script>
function runLoop ()
{
for (var i = 0; i < 3; i++) { i--; }
}
window.onload = runLoop;
</script>
Doesn't have this problem.
Perhaps this an issue with dev console?
,
May 24 2017
,
May 30 2017
This behavior can only be observed with devtools opened. We are disabling the watchdog since we'd like web developers to have direct access to the execution. You can pause the page via pressing the pause button in the sources panel. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by 62...@wsdoc.me
, May 23 2017