Firefox 在最小化(长轮询)时会停止运行 JavaScript 吗?
我正在运行长轮询,但是当我在 Firefox 中打开新选项卡或最小化浏览器时,长轮询似乎超时了!?但是,如果我选择该选项卡,或者在 Firefox 打开的情况下创建一个新的专用窗口,则不会超时。
有谁对这种奇怪的行为有任何想法或见解吗?当最小化/备用选项卡时,Firefox 会停止在这些选项卡中运行 JavaScript 吗?
顺便说一下,我使用的是 Firefox 3.6。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,它不会停止运行 JavaScript。并且它不会阻止您修改 DOM。我有一个应用程序在服务器上运行轮询(我有同步和异步传输),然后根据结果更新 dom。如果我查看选项卡或 Nor,即使 Firefox 3.6 已最小化 - 它也能正常工作。在发布这个答案之前,我刚刚(再次)测试了它。
即使是像 selenium (在 javascript 中)这样操作 DOM 的 javascript 测试工具也在没有焦点的情况下工作。
因此,请检查您的代码,它可能确实需要关注某些选项卡或某些元素(如建议的 syockit )。我相信你有firebug,你可以轻松地分析和调试你的javascript(如果它没有被混淆)。
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).