6
1
There I was downloading a bunch of stuff from the Internet quite happily using Firefox built-in download manager when I decided to check code academy (a site that teaches you how to program in javascript, in a cool way - apparently).
So after playing with a few exercises I got to lesson 7 (item 4) which requires you to fill the conditions of a for
loop to bring i
(the loop variable) down to 0. What happened is that instead of writing the loop as for (i = 2; i >= 0; i--)
which would trigger the inbuilt-mechanism that would take me to the next lesson, I "mistakenly" wrote is as for (i = 2; i >= 0; i++)
, making the loop go on forever causing Firefox to use 100% of the CPU, frizzing everything, and frustrating all my attempts to reload the page or close the tab.
Right now I have paused the process through kill -STOP <pid>
, but I don't want to close Firefox because I'm downloading a bunch of stuff that can't be resumed, and I wonder if there's a way to close this tab through the command line. Maybe there's a way to list all firefox' threads and try to close them individually (worst case, I think GDB can assist me on this).
I'm currently using Mac OS X 10.7.2.
3Switch to Chrome, perhaps? :) – Marvin Pinto – 2012-01-08T19:48:38.237
1I get the joke, haha, but that doesn't help me to achieve anything. – karlphillip – 2012-01-08T19:53:34.460
1In all seriousness though, I don't think you'll be able to do what you need. Firefox, unlike Chrome, opens all tabs in the same memory space which is why one misbehaving java/flash/whatever site will bring down all your browser sessions. Probably the same reason you can't kill one tab from the command line. – Marvin Pinto – 2012-01-08T20:00:17.283
1I see you're trying to close a firefox tab though the console. You should totally drop that and try jQuery. – Alex Coplan – 2012-01-08T20:26:05.383
But seriously, I don't think it's possible... http://stackoverflow.com/a/2076307/840973 - see the comments on the top answer
– Alex Coplan – 2012-01-08T20:31:21.320@Marvin: "one misbehaving java/flash/whatever site will bring down all your browser sessions" ← actually, that's not quite right: since version 4, Firefox has a new file called
plugin-container
which launches a new process with the plugin, instead of embedding it in the main process. Usually you can actually kill this process without affecting the browser itself. The problem here is that Cool Academy doesn't actually use a plugin, but JS which is implemented by Firefox itself. – André Paramés – 2012-01-09T03:14:13.993@karlphillip: if you have paused the process (and possibly even if you hadn't), the TCP connection to the server(s) has probably timed out already, so even if you get Firefox to work again, it might tell you that "
filename
could not be saved, because the source file could not be read". – André Paramés – 2012-01-09T03:18:46.323@AndréParamés That's interesting, I wasn't aware of that. Does Firefox's container concept apply to tabs as well? If for example I had a (misbehaving) flash video playing in one tab which needed to be killed. After killing it, would it also affect any other tabs that I may have had open with flash videos (again, silly example but bare with me). I ask because in my understanding of how Chrome works, each tab is somehow sandboxed and killing one (be it directly or via process explorer/activity monitor), will certainly not affect any other. – Marvin Pinto – 2012-01-09T03:31:26.787
@Marvin: No, a single plugin-container will be launched per plugin, regardless of on how many tabs it is used. So if a Flash video is unresponsive, killing the process will kill all other Flash components in all tabs. It doesn't kill the whole tab, though, just the Flash part. – André Paramés – 2012-01-09T19:18:17.620