LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 09-15-2009, 06:39 AM   #16
crxssi
Member
 
Registered: Apr 2005
Location: USA
Distribution: Mageia
Posts: 84

Original Poster
Rep: Reputation: 15

I am quite aware that javascript is just a language and there are likely no simple "animation calls" that could be instantly targeted. But I suspect that most sites that use code to do animation use similar techniques- like moving a bitmap on the screen, fading something from one level of transparency to another, or perhaps even some type of typical looping. Those types of operations might be identifiable. Or maybe even just how much CPU a site is using while a user isn't doing anything, before it triggers a javascript pause or something.

As for "just don't go there"- unfortunately, I can't control what websites my users need to use, nor can I control what those websites do. Other sites we can't avoid, because we *have* to use them, since they are part of normal business.

It isn't just because we use thin clients. Others could benefit from some type of control over animation too. Not only can animation be very annoying, but, for example, on laptops or handhelds it can noticeably drain the battery through lots of additional CPU load.
 
Old 02-09-2010, 10:26 PM   #17
crxssi
Member
 
Registered: Apr 2005
Location: USA
Distribution: Mageia
Posts: 84

Original Poster
Rep: Reputation: 15
Well, still not much good to report. Time goes by and more and more and more sites find that they just HAVE to add all kinds of strange and annoying animation to their sites.

I keep hoping for some new addon to come along that will somehow monitor for animation and stop it. I was thinking one way would be to monitor for scripts that are active or in sleep loops and target those.... since most animation I have seen does something (like scroll or fade, wait, then do it again, over and over again). Another useful technique would be to monitor for script that are using more than X amount of CPU and zap those... but I doubt the browser will have access to that type of info. Yet another thing that would be helpful is to suspect scripts when the window or tab doesn't have focus.

In the meantime, I have found this simple addon that does help some:

https://addons.mozilla.org/en-US/firefox/addon/5757

It is called "JS Switch". It does nothing but add a "JS" icon on the taskbar or status bar. One click and all javascript is instantly disabled or re-enabled. Unfortunately, it affects all tabs and windows. Also unfortunately, the existing scripts do not restart when you re-enable javascript again, requiring a page reload (although sometimes it is nice- you can just double click on "JS" and it disables then re-enables, stopping most animation and you don't have to remember to turn it back on again)

But, it is an immediate way to stop those extremely annoying pages with movement. The Noscript addon remains a 1,000 pound gorilla, which I find creates more problems than it solves (for me).

Last edited by crxssi; 02-09-2010 at 10:43 PM.
 
Old 02-10-2010, 12:18 PM   #18
Tom Austin
LQ Newbie
 
Registered: Sep 2009
Posts: 12

Rep: Reputation: 0
Funny you bring this up today. I just installed a Firefox add-on that is supposed to target certain javascript actions, which it does, just not the actions I need. It's Controle de Scripts.

What we need is an add-on that you can copy js commands from the View Source pane, enter the URL and block that specific script.

I know nothing about developing XPIs, so maybe I can suggest this to FF developers as building into FF.

I went to newspaper site (statesman.com) where they have a js image rotator. I can turn it off with NoScript, but of course, that blocks other text content that for whatever reason requires js just to be visible.

So I used AdBlock Plus to get rid of the div that contained the rotating images. Problem is, it also got rid of the underlying headlines associated with those images.

That's why we need something to selectively block js, or at least change the timing sequences from four seconds to two minutes.

Tom
 
Old 02-10-2010, 06:56 PM   #19
crxssi
Member
 
Registered: Apr 2005
Location: USA
Distribution: Mageia
Posts: 84

Original Poster
Rep: Reputation: 15
I tried "Controle de Scripts" and found it to be pretty much useless for what I need to do.

I doubt it would be built into FF, it would probably always be in the addon type category. I would make suggestions to "them" to, but I don't know where or really to whom. Except maybe to the developers of something SIMILAR, like Noscript.
 
Old 02-10-2010, 07:01 PM   #20
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Mageia Studio-13.37 Kubuntu.
Posts: 3,325
Blog Entries: 33

Rep: Reputation: 199Reputation: 199
I set up noscript to block "Base second level domains"

This is more selective, and does not block the entire sites advertisings.

HTH, Glenn
 
Old 02-11-2010, 11:52 AM   #21
Tom Austin
LQ Newbie
 
Registered: Sep 2009
Posts: 12

Rep: Reputation: 0
Glenn, can you elaborate on how "Base second level domains" can stop animations?

I spent some time trying to figure out Greasemonkey. I've not been able to make it work. Here's a selection of animation code that rotates headlines on our newspaper site www.statesman.com.

I've tried and tried to get Greasemonkey to block it and have yet to get it to work. I've even tried replacing the delay time with 400000 (400 seconds) to no avail. Any help from those who know scripting will be very much appreciated.

<script type="text/javascript">
function theRotator() {
theInterval = null;
delay = 4000; // 4 seconds
//Set the opacity of all images to 0
jQuery('div#imageRotator ul li').css({opacity: 0.0});
jQuery('div#tabRotator ul li').addClass('off');
//Get the first image and display it (gets set to full opacity)
jQuery('div#imageRotator ul li:first').css({opacity: 1.0});
jQuery('div#tabRotator ul li:first').addClass('show');
//Call the rotator function to run the slideshow
theInterval = setInterval('rotate()',delay);
};
jQuery('#tabRotator').hover(function() {
stopSlideShow();
}, function() {
startSlideShow();
});
jQuery('#imageRotator').hover(function() {
stopSlideShow();
}, function() {
startSlideShow();
});
function stopSlideShow() {
if(theInterval) clearInterval(theInterval);
hoverTabs();
};

Tom
 
Old 02-11-2010, 06:04 PM   #22
crxssi
Member
 
Registered: Apr 2005
Location: USA
Distribution: Mageia
Posts: 84

Original Poster
Rep: Reputation: 15
I, too, would be interested. About the only thing I think might be something that could be effectively and generically targeted to stop most animation without overly interfering with other code that makes forms and selectors and such work, is to find sleeps within loops. But how to find and modify such things?

I can almost guarantee there is no code I want running on MY browser that has a loop with a sleep in it- it guarantees that it will be doing something over and over again, consuming CPU time, slowing down the browser, probably facilitating movement on the screen, fadein/out transitions, and/or reloading objects. A "kill javascript animations" addon using this technique might be the ticket.... something that finds such sleeps, replaces them with extremely long values, and pops up an icon on the status bar letting the user know it was zapped and to click on it to restore the original code.

This would be EXTREMELY useful for people who are annoyed by animation, are using slower machines, are using remote machines, or are trying to use thin clients.
 
Old 02-11-2010, 09:21 PM   #23
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Mageia Studio-13.37 Kubuntu.
Posts: 3,325
Blog Entries: 33

Rep: Reputation: 199Reputation: 199
Well, I just use the settings in NoScript.

I'm not a scripter, sorry. Some basic knowledge, but very limited.

What it means is that if I'm looking at a page from

http://www.some-primary-site/seconda...uff/index.html

I can allow http://www.some-primary-site/seconda...uff/index.html

but block any java script that would direct adds and animations to the page being viewed.

and also block any java scripts from

www.some-primary-site/secondary-site

and

www.some-primary-site

You might also try a proxy web server like squid to block content you don't want.

in conjunction with your Firewall (iptables?)

ref. http://www.linuxhomenetworking.com/

or just uninstall flash!

cheers, Glenn
 
Old 02-11-2010, 09:41 PM   #24
crxssi
Member
 
Registered: Apr 2005
Location: USA
Distribution: Mageia
Posts: 84

Original Poster
Rep: Reputation: 15
Glenn, I am afraid that wouldn't help much. Would likely break javascript that is necessary for the site coming from other areas of the site. Adblock will take care of most of the rest.

I was thinking about it some more and ran some tests and I think I found a pretty good concept. Something that doesn't require any configuration or management and with a very low probability of breaking anything...

It is based on the "JS Switch" addon. If you load a page, and then click on JS twice, it will stop any running scripts (and that is mostly animation loops), then enable scripts to run again right afterward. After restarting javascript, the code causing the animation will not restart (which is good), unless a roll-over brings that back to life. I tested this on many sites and it seems to work 100% of the time without breaking anything of value.

If that were combined with the ability to also stop running scripts when the browser window loses focus, it would be even more powerful (since a rollover or self-reload might activate a running script again).

This method can be done without it needing to inspect or or modify any of the javascript code, it just has to know when the page has finished loading so it can deactivate and reactivate javascript (and for the second part, know when the window loses focus).

What do you think? Pros? Cons?

EDIT: I found that perhaps my stop/start thing doesn't work on as many sites as I thought.... but not sure why

Last edited by crxssi; 02-11-2010 at 10:31 PM. Reason: new info
 
Old 02-11-2010, 10:01 PM   #25
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Mageia Studio-13.37 Kubuntu.
Posts: 3,325
Blog Entries: 33

Rep: Reputation: 199Reputation: 199
Pros, good for saving bandwidth.

cons, any connected user would have to know what you know to make it usable network wide.

Because it requires "live" user intervention. So It would (probably) not be used by normal users who don't care about your networking loads and/or costs.

<edit>
In my experience, most, but not all adds, come from links to the web page from outside the domain of the viewed webpage,

noscript allows me to trial these links, and block (temporarily or/and then after inspection permanently) those specific add links.
</edit>

cheers, and all the best, Glenn

Last edited by GlennsPref; 02-11-2010 at 10:05 PM. Reason: edit
 
Old 02-12-2010, 10:26 AM   #26
Tom Austin
LQ Newbie
 
Registered: Sep 2009
Posts: 12

Rep: Reputation: 0
I learned something about NoScript. First, I already used it to block a div that contained the offending javascript elements. Problem is, it blocked all the content in that div that I'd like to see static, not moving.

So I disabled that filter and opened up the list of blockable items in NoScript. I found several scripts that could be blocked, which included the offending material. It worked, causing the moving material to remain on the page as static material, which is better than just blocking the whole div. The problem is, when I block one, it automatically blocks others (four total) in that category, so there is other content that is blocked that I don't want blocked. It's beyond me why a web developer would use JS to simply display a block of text.

I think we're getting closer to understanding what it would take. Part if it may be getting to know the capabilities of existing extensions. It would help if such solutions were compiled all in one place that can be easily searched. I'm having a devil of a time getting Greasemonkey to work with this.

Tom
 
Old 02-12-2010, 01:24 PM   #27
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Mageia Studio-13.37 Kubuntu.
Posts: 3,325
Blog Entries: 33

Rep: Reputation: 199Reputation: 199
I wonder if any of the settings in about:config in firefox could be adjusted?

I'm no coder, but I was just looking at mine and there are some that are disabled, that might otherwise prove useful for this threads purpose.

I was just fixing the "open new tab to the right of the current tab", which was anoying me a bit,

and noticed noscript has a good list of configs, some of look like scripts, not just on or off.

Just a suggestion, in case you ppl know what to do with it.

regarsd Glenn
 
Old 05-23-2010, 06:36 PM   #28
crxssi
Member
 
Registered: Apr 2005
Location: USA
Distribution: Mageia
Posts: 84

Original Poster
Rep: Reputation: 15
Just gotta BMG a bit again... First, a few days ago I notice the main (thin client) server at work being pegged all day and not sure why. Well, it was Google's attempt at humor with their (now famous) very annoying PacMan banner crap.

Months ago Office Depot added one of those annoying full width animated scroller things on their home page (so did CDW and lots of other sites), and I start getting complaints from users "why is the Office Depot site so incredibly slow?".

Then today (at home) I go to a site I regularly monitor: http://www.precentral.net/

They just added "Featured Apps" section on the right, and it is on EVERY PAGE of the site. Constant smooth animation. 1/2 of my home CPU is completely consumed by that crap and I can find no way to block it. And so distracting, just to read the articles, I had to resort to resizing the window to the size of the text column on the left.

First we had animated GIF's- extremely annoying, easily blocked.

Then we had animated Flash banners- extremely annoying, uses lots of CPU,
easily blocked with Flashblock or whatnot.

It would appear that all this crappy AJAX/2.0/javascript/whatever animation crap is the 2010 version of animated GIF's, with the bonus of being nearly impossible to block and using 10,000 times more CPU.

But isn't it so "cute"???? Grrr.

Last edited by crxssi; 05-23-2010 at 06:38 PM.
 
Old 05-24-2010, 12:36 AM   #29
John VV
Guru
 
Registered: Aug 2005
Posts: 12,949

Rep: Reputation: 1719Reputation: 1719Reputation: 1719Reputation: 1719Reputation: 1719Reputation: 1719Reputation: 1719Reputation: 1719Reputation: 1719Reputation: 1719Reputation: 1719
why not use ad block and no-script
they get ride of 99% of them .now some sites do need "java-script" running to work ( you get a " we are sorry but no-script was detected" page
 
Old 05-24-2010, 06:23 AM   #30
crxssi
Member
 
Registered: Apr 2005
Location: USA
Distribution: Mageia
Posts: 84

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by John VV View Post
why not use ad block and no-script
they get ride of 99% of them .now some sites do need "java-script" running to work ( you get a " we are sorry but no-script was detected" page
See the rest of the thread... I do use adblock, No-script I have tried before and it really is a nightmare. Sites rely on Javascript for just about everything now. Plus they keep changing. About the only thing that is going to work is a plugin/addon that has some type of loop detection and disablement.
 
  


Reply

Tags
blocking, firefox, javascript, webbrowser


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
JavaScript and Firefox JonBL Linux - Newbie 4 11-17-2007 02:49 AM
Anyone know how to Block JavaScript from being run in HTML Comment Editors farmerjoe Programming 8 02-13-2007 02:57 PM
Ubuntu Edgy/Firefox 2/Javascript - Firefox closes accessing websites with Javascript Interdictor Ubuntu 8 11-02-2006 11:58 AM
javascript in firefox jackdoll Fedora 1 11-19-2005 02:18 AM
No sound or animation in Firefox or Thunderbird chumley115 Fedora 23 11-24-2004 04:32 PM


All times are GMT -5. The time now is 06:55 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration