When you get an infinite loop in jsfiddle in Chrome, your only choice (that I know of) is to close the tab. Of course, this means you lose all your work in the current window! Is there an easy way to stop an infinitely executing script?
- I have the developer tools open because I was doing some debugging.
- I am able to pause the script and step through the loop.
- I can't find anywhere to stop the script.
- I can't modify the script or variables to stop the infinite loop (because the script execution occurs in an iframe on a separate domain, so modifying data in the iframe with JavaScript is not allowed and generates an Exception in the console).
It all started because I decided to swap directions on my loop from
for (var c = 0; c <= 11; c++)
to
for (var c = 12; c > 0; c++)
But as you can see above, I forgot to change it from c++
to c--
.
Any ideas?? I still have the tab open and I'm hoping to get it back without closing the tab :-)
I couldn't start Chrome's Task Manager while the looping tab was active. I had to select another tab. Then I pressed Shift-Escape to launch the Task Manager, kill the JSFiddle process, re-select the tab, and hit the back button to display the page without running the script.
JSFiddle loads the "result" panel using an iframe. As of June 2016, the URL for the frame is the Fiddle URL plus "/show/". I inspected the source code of the iframe and discovered that it loads yet another URL with "/light/". One of these URLs should contain your source code.
If your browser supports the view-source URI scheme, you may access your fiddle's source code as follows:
In case others are stuck after reading the other answers, here's what worked for me (Chrome, Mac). For me the JSFiddle tab was 'stuck' but the rest of Chrome responsive. I had the JavaScript Console open on the Resources pane, but it was unresponsive too. Reloading the page in this state didn't help because JSFiddle would give me the script before I got anything at all.
In the end this worked for me; maybe it will help you too...
Chrome > Preferences > Privacy
and disable JavaScript.View > Developer > View source
div
called'panel_js'
.