Page 1 of 1
Feature Request: disabling javascript on background tabs
Posted: Thu May 28, 2009 10:10 am
by jpoje
I'm not certain if this is feasible with noscript or whether it would have to be done by the core FF team, but it certainly fits within noscript's functionality area.
Basically, I got really tired of FF always running such a high CPU usage with a lot of tabs open and started thinking about what could help prevent or ease it from happening. While I'm sure a part of it is FF itself, I also suspect that a (large?) portion of that processing time is javascript on various pages eating cycles.
What I am proposing is that in addition to the current restrictions on what domains noscript lets javascript run from there should also be an option to suspend javascript execution in background tabs until they come to the foreground again (with a whitelist of course). This would prevent any pages you want to keep around to reference (but don't care about interim javascript functionality) from eating CPU cycles. Hopefully this is a) a good idea and b) feasible. Thanks for reading.
Re: Feature Request: disabling javascript on background tabs
Posted: Tue Aug 04, 2009 7:07 pm
by Shemesh
I support this totally, it makes good sense. Please see my comment to a related post in the Development forum "run scripts only on active tab"
Here's hoping!
Re: Feature Request: disabling javascript on background tabs
Posted: Tue Aug 04, 2009 10:03 pm
by Foam Head
I understand and agree with the intent of this request, but I think it has some security implications. Many secure web sites use JavaScript timeouts to track when you are idle and automatically log you out. So, for example, if you log into your bank, switch to another window/tab, and then leave your computer for 30 minutes, anyone that sits at the keyboard can switch back to your bank's tab and access your account.
To do this properly, what you need is for JavaScript and DOM to adopt a "sleep"/"unsleep" API. Without such an API for scripts to implement, you would have to force applications to sleep/unsleep without their knowledge which could lead to unknown, and perhaps unsafe, effects.
-Foam
Re: Feature Request: disabling javascript on background tabs
Posted: Sat Aug 08, 2009 4:12 pm
by mikell
I certainly agree with the concept of disabling javascript on background tabs. Whether or not to do so automatically, may be an issue, but at least the option to use a button the tab bar or elsewhere would be a nice addition for times when Firefox is just sitting at 50% or more processor usage with many tabs open, as I am wont to do. The security issue mentioned shouldn't be a problem since NoScript can handle scripting on a site by site basis. The main issue here is that we would be able to trim down and control which tabs are grabbing our processor power.
I want this badly and may just try GreaseMonkey to achieve it.
Re: Feature Request: disabling javascript on background tabs
Posted: Sat Aug 08, 2009 4:20 pm
by Alan Baxter
mikell wrote:the option to use a button the tab bar or elsewhere would be a nice addition for times when Firefox is just sitting at 50% or more processor usage with many tabs open, as I am wont to do.
The Tab Mix Plus extension supports turning off JavaScript for individual tabs. Right-click > Permissions
Re: Feature Request: disabling javascript on background tabs
Posted: Sat Aug 08, 2009 7:48 pm
by mikell
If you have 50 tabs open, finding which tab is using cpu time is very difficult, which is why I want a single button to temporarily disable all javascript (at least) in background tabs (or all tabs). Otherwise I, and many others, would love to have some way of showing which tabs are hogging cpu resources. I know I can use different extensions to disable javascript in any specific tab, but finding the tab can be very hard to do.
Re: Feature Request: disabling javascript on background tabs
Posted: Sat Aug 08, 2009 8:06 pm
by Alan Baxter
I figured you'd say that. The
QuickJava extension supports disabling JavaScript for all tabs with one click on a status bar icon. Would that help at all?
Re: Feature Request: disabling javascript on background tabs
Posted: Sun Aug 09, 2009 12:23 am
by mikell
Thanks for the referral. I did install QuickJava and, as expected, the disable buttons are helpful, reducing the CPU usage to near zero when pressede, especially when scripting has (perhaps unwittingly) sort of hijacked FF, but they still do not help determine which tab is offending. That still seems to require going from one tab to the next and closing them and reopening them if they are not the culprit. Furthermore, even when I finally find the tab (
http://www.ecnmag.com/article.aspx?id=1 ... on=effzone in this case) I haven't even been able to disable the ticker tape display of news which is the problem, using NoScript, other than perhaps applying noScripting to the entire site, which I haven't yet tried to see if it's still usable that way.
I still wish most for some kind of indicator for which page has a CPU hogging script running.
Re: Feature Request: disabling javascript on background tabs
Posted: Sun Aug 09, 2009 3:32 am
by Alan Baxter
mikell wrote:Furthermore, even when I finally find the tab (
http://www.ecnmag.com/article.aspx?id=1 ... on=effzone in this case) I haven't even been able to disable the ticker tape display of news which is the problem, using NoScript, other than perhaps applying noScripting to the entire site, which I haven't yet tried to see if it's still usable that way.
The
Adblock Plus extension blocks those tickers if you use the following filter:
Code: Select all
http://www.ecnmag.com/RSSPRNewsWire.aspx
I still wish most for some kind of indicator for which page has a CPU hogging script running.
That's a common request. I bet if you search
bugzilla, you'll find it officially requested already.
Edit: By the way, I'm sorry I didn't notice this earlier, but you need a Firefox update. We registered users can see the user agent string your browser sends. It indicates you are running an obsolete version of Firefox. It's easier to troubleshoot these issues if you're using the current version. Also, it's risky to use an old version of Firefox which has known, published, unpatched vulnerabilities. NoScript is a useful security tool, but even more effective is running with an up-to-date Firefox. Help > Check for Updates.
Re: Feature Request: disabling javascript on background tabs
Posted: Mon Aug 10, 2009 4:49 pm
by therube
OK, I might be somewhat receptive to this or a similar idea.
How about providing some instances where something like this would be beneficial?
The "marquee". Thats one.
Once you've Allowed a Flash Object, it will remain, regardless of JavaScript settings, so no help there.
Animated GIFs would not be affected, so again no help.
Now what else?