Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Firefox stop running JavaScript when minimized (longpolling)?

I have a longpoll running but when I open a new tab in Firefox, or minimize the browser the longpoll seems to time out!? However if I leave the tab selected, or make a new dedicated window with Firefox open it won't time out.

Does anyone have any thought or insight on this weird behavior? When minimzied/alternate tab does Firefox stop running JavaScript in those tabs?

By the way I'm using Firefox 3.6.

like image 501
pipinghot Avatar asked Nov 20 '10 06:11

pipinghot


1 Answers

No, it does not stop running JavaScript. And It does not block you from modifying the DOM. I have an app that runss a poll on server (I have both synchronous and async transmission) and then updates the dom based on results. And if I am looking at the tab or nor, and even if the firefox 3.6 is minimized - it just works. I have just tested it (again), before posting this answer.

Even the javascript test tools like selenium (in javascript) that are manipulating the DOM are working without focus.

So please check your code, it probably does require focus on some tab or on some element (like syockit suggested). I belive that you have the firebug, and you can easily analyze and debug your javascript (if it is not obfuscated).

like image 197
bartosz.r Avatar answered Oct 19 '22 01:10

bartosz.r