6
2
Often I have lots of tabs open.
Often, these tabs can be seen cheerfully burbling away, doing whatever snake stuff Google thinks it should be doing on my system.
I then check my IDS to see what happened. This process gets a bit tiresome, and during my thoughts on this general topic it occurred to me to ask:
Is there a way to have javascript only work for the tab in focus?
For example, on this page we are looking at, javascript would be working, but on all other tabs, nada.
Is this even possible?
Interesting question, definitely. But is there any specific reason why you'd want this feature? – slhck – 2011-05-08T17:37:11.993
Yes. I reread the story of the tabnabbing attack for one, and Task Manager often shows tabs accessing network resources, and really, if i'm not using them, then why even bother? Much more to the point, I don't need a 'reason' to want to alter behaviours that I find unpleasant on my system. I'm open minded though. Is there a specific reason why I should not contest this loss of autonomy? – chiggsy – 2011-05-08T17:57:30.493
Well, most "major" websites who tend to use network resources in the background are those who reload items without the entire page having to be reloaded. That is also the reason why they keep running all the time. Pages like this are Google Reader/Mail, Gizmodo, Facebook and so on. Disabling Javascript as soon as you switch away from the current tab would could lead to some issues such as timing problems, event handling, connection loss of these tabs. Gmail Example: To receive new mails in your webapp, you have to ACTIVELY switch to the gmail tab. – private_meta – 2011-05-08T18:39:09.353
To add to the gmail example: You'd probably kill features such as uploading files once you switch away from the tab you are currently uploading your file in, but that might possibly not be an issue – private_meta – 2011-05-08T18:40:24.670
(I know very little of Chrome.) This is the only "NoScript"-like extension I have heard of for Chrome, though don't know if it will do what you want, "NotScripts" https://chrome.google.com/webstore/detail/odjhifogjcknibkahlpidmdajjpkkcfn ?
– therube – 2011-05-08T19:16:04.740@private_meta That's what I'd suggest too. If you stop a script's execution you won't be able to start it again without having to reload the page. – slhck – 2011-05-08T19:20:29.167
I've also wondered about such a feature. I don't see why it shouldn't be done, anyone using it is likely to understand the complications which can arise from stopping scripts - see NoScript users. Personally I use a separate browser for websites which are obsessive about javascript usage, and I don't keep said browsers open for long. – Jeff Welling – 2011-05-08T19:54:03.760
I wonder if this could simply become a NoScript extention. It seems like the logical way to go for NoScript, they already block scripts, why not add more fine-grained control so that the (optionally) the only scripts running are on the page your currently viewing. Why should I allow scripts from Facebook or any other site to run on any site which isn't Facebook? </Rhetorical question> – Jeff Welling – 2011-05-08T19:56:12.353
@I'm ok with page reloading actually, and I remember uploading files pre javascript, is the concept of 'graceful degradation' dead? – chiggsy – 2011-05-09T01:14:32.737
@Jeff, NoScript's ABE already does that. (Doesn't help for Chrome though.) "ABE - Application Boundaries Enforcer" http://noscript.net/abe/
– therube – 2011-05-11T05:09:56.383