LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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-08-2009, 09:52 PM   #1
Tom Austin
LQ Newbie
 
Registered: Sep 2009
Posts: 12

Rep: Reputation: 0
How does Firefox Linux differ from Firefox Windows?


Hi, I'm new here. I'm trying to get Firefox to allow me to selectively block javascript without blocking the whole page. I'm trying to reply to a posting on this, but as a new member I see I must post this first.

Thanks.

Tom Austin
 
Old 09-08-2009, 10:48 PM   #2
irishbitte
Senior Member
 
Registered: Oct 2007
Location: Brighton, UK
Distribution: Ubuntu Hardy, Ubuntu Jaunty, Eeebuntu, Debian, SME-Server
Posts: 1,213
Blog Entries: 1

Rep: Reputation: 88
Hi there and welcome. Most things in firefox, be it windows or linux are accomplished with add-ons, which allow you to do many things, not least of which is your question. There is an addon called NoScript listed here: http://www.makeuseof.com/tag/best-fi...y-and-privacy/ might be what you're looking for?
 
Old 09-09-2009, 12:04 PM   #3
Tom Austin
LQ Newbie
 
Registered: Sep 2009
Posts: 12

Original Poster
Rep: Reputation: 0
Thanks, I use NoScript, and it allows blocking all or none. I want to block only certain parts of the javascript, such as javascript animations.

Surely there's a way to accomplish this?

Thanks!

Tom
 
Old 09-09-2009, 12:13 PM   #4
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
Can you be specific about the animations, and/or point us to a link where we can SEE an example of what you want to kill?

For example, I would like to know if you wish to kill animated GIF's (I don't know if these even require javascript ). If so, there's a firefox built-in configuration option for configuring animated GIF behavior.

Also, AdBlock is more than just an adblocker -- http://adblockplus.org/en/filters shows some examples of how to use AdBlock to block other elements in webpages besides just Ads.

Sorry if I'm over/under simplifying the issue, but as I asked, an example would be great

Thanks,
Sasha
 
Old 09-09-2009, 07:40 PM   #5
Tom Austin
LQ Newbie
 
Registered: Sep 2009
Posts: 12

Original Poster
Rep: Reputation: 0
Thank you for asking. Here's a perfect example:

http://eanesisd.hcms.schoolfusion.us/

Viewing source reveals the following javascript slide show that I want to disable:

<div id="slideshow"><!--start rotating image system on right-->
<script language='javascript' src='/includes/js/slideshow.js.php?bgcolor=ffffff&folder=slideshow2&defaultShow=t&sessionid=a5c969d0938912c8fbb5f9738f 240044'></script><script language='javascript'>
new fadeshow(fadeimages, 515, 196, 0, 4000, 1, "R");
</script> </div>

I've tried AdBlock, but all it will do is block the blank png file under the fill pictures. I've tried to locate the fill pictures, and I can't find them to block them individually. I've tried creating a user.js file to block it, and I can't even get that to work. (see http://www.mozilla.org/projects/secu...figPolicy.html)

NoScript blocks all or none, not selective javascript on a page.

I know there must be a way! THANKS!

Tom
 
Old 09-09-2009, 07:52 PM   #6
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
Is that the stupid image-changing thing in the top right corner?

Do this:

Open your Adblock preferences, select "Add Filter" and enter the following:

Code:
schoolfusion.us##div[id^="slideshow"]
And tell us how that works
Sasha
 
Old 09-09-2009, 07:54 PM   #7
nathanpc
Member
 
Registered: Aug 2009
Location: Brazil
Distribution: Ubuntu Lucid
Posts: 45

Rep: Reputation: 15
Tom Austin put the code tags!
 
Old 09-09-2009, 07:55 PM   #8
nathanpc
Member
 
Registered: Aug 2009
Location: Brazil
Distribution: Ubuntu Lucid
Posts: 45

Rep: Reputation: 15
As i know it differ in some plugins for it!
 
Old 09-09-2009, 08:06 PM   #9
Tom Austin
LQ Newbie
 
Registered: Sep 2009
Posts: 12

Original Poster
Rep: Reputation: 0
AdBlock did it, with your help. I had no idea it was so powerful.

I had to click the icon to get to the right menu, and I added the FF extension to help identify the blockable items, though that wasn't necessary, as the slideshow pictures showed up in the list of blockable items. I would never have been able to find them myself!

Thanks for solving my problem!


Tom

Last edited by Tom Austin; 09-09-2009 at 08:19 PM.
 
Old 09-09-2009, 08:10 PM   #10
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556


No problem, happy to help.

While it can be a bit of a chore, I generally just go to "View Source" of a page, and search down to locate the type of tags surrounding the offending item. Maybe (probably) there's an easy way (like that FF extension you mention) but either way, it works out the same, though if you get good with that extension you mention, it'd probably be a few seconds job (ok, maybe 10 or 20 seconds ).

I think I put the link above, but I'll again put the link here for you, which is where I figured out (with some trial and error) how to make this filter and similar ones.

Adblock element filtering: http://adblockplus.org/en/filters

Happy browsing!
Sasha
 
Old 09-09-2009, 08:21 PM   #11
Tom Austin
LQ Newbie
 
Registered: Sep 2009
Posts: 12

Original Poster
Rep: Reputation: 0
Sasha, then I read your post about the div id blocking. That works too. Question:

How did you to use brackets around the div id? The page source has this:

<div id="slideshow"> but the AdBlock rule is this: schoolfusion.us##div[id^="slideshow"]

The link you provided suggests leaving out the brackets and carat...

How did you know you didn't have to include the whole path, just school fusion? Where can I learn the syntax to use the carat and enclose in brackets? This is good stuff. Thanks again.

Tom
 
Old 09-09-2009, 08:34 PM   #12
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
The [brackets], carat, etc., comprise a "Regular Expression", otherwise commonly known as a "regex".

AdBlock allows for, and supports to a great degree, regular expressions; this allows for matching to multiple strings, which all share the matching criteria, as opposed to the default behaviour, which as you found out, tends to block in an "all or nothing" manner, which we sometimes don't want.

A basic regular expression, depending on the exact context where it's being used, is often enclosed in [brackets] or surrounded by /slashes/ like so.

In the example I gave you for that slideshow, the regex matches anything where the <div> tag's "id" section begins with "slideshow". The carat means "at the beginning of", while a $ sign means "at the end of"

I should also point out, that regex's are a very important of day to day Linux commandline activities; most/many linux commands/tools, like sed, awk, gawk, grep, and on and on, can match regular expressions for the data you feed them.

In the slideshow example, you could use:

^slidesh

and get the same result; it would block anything matching "slidesh*" regardless what came next. If you had slideshow1, slideshow2, and slideshow3, but you only wanted to see 1 & 2, you could use ^slideshow3 to block number 3.

Google up some "regular expression" tutorials, or "Bash regular expressions" for full details.

Sasha

Last edited by GrapefruiTgirl; 09-09-2009 at 08:43 PM.
 
Old 09-09-2009, 08:56 PM   #13
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
PS -- you had asked about the domain name too, so:

somesite.org = a domain name
hello.somesite.org = a subdomain.
food.hello.somesite.org = a sub-sub domain.

So, in the case of your slideshow thing, I chose to block the slideshow at the domain level; this means that even if the slideshow comes from any sub-domain of somesite.org, it will get blocked.

If you only wanted to block stuff from hello.somesite.org, but not from the main domain, then you would need to put that subdomain (hello) at the start of the domain path. That would block slideshows from hello.somesite.org, but NOT from somesite.org or any other subdomain other than 'hello'.

Hope that's clear

Sasha
 
Old 09-09-2009, 09:35 PM   #14
Tom Austin
LQ Newbie
 
Registered: Sep 2009
Posts: 12

Original Poster
Rep: Reputation: 0
Very clear, thank you. I've learned a lot on this thread. You write well and this is an excellent welcome!

Tom
 
Old 09-09-2009, 09:46 PM   #15
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
LOL

I didn't even realize I had basically been addressing your other firefox thread issue, but replying in THIS thread. Heh, silly me and as a result I've helped you take this thread way off the original topic of "how FF differs in Win vs. Linux". So...

I'm going to ask another moderator who deals with merges and moves of threads/posts for this forum (Linux - Software), to take our posts about the regex's & javascript & AdBlocking stuff, and merge them over onto that other thread you started, where they are certainly more appropriate -- or maybe we'll just merge the two together, and rename it "Firefox: AdBlock javascript elements using regex" -- what do you think?

You don't have to do a thing, but if you like, hit the report button and provide a suggestion if you would like to influence how the thread(s) get merged; and sorry for the crossposting folks!

Sasha

Last edited by GrapefruiTgirl; 09-09-2009 at 09:50 PM. Reason: I was replying in the wrong thread :p
 
  


Reply



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
LXer: Tutorial: Why Firefox Rocks on Linux: Great Firefox Tricks, Part III LXer Syndicated Linux News 0 11-07-2008 06:30 AM
Linux Firefox Slower than Windows Firefox on same machine gherikill Linux - Software 17 02-21-2008 12:06 AM
Firefox linux & FireFox windows observation shotokan General 66 12-16-2005 07:17 AM
firefox on windows and firefox on linux boxerboy Fedora 7 08-13-2005 06:49 PM
Symlinking Firefox Extensions from Windows to Firefox? apachedude Linux - Software 11 11-26-2004 05:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration