Welcome guest, is this your first visit? Create Account now to join.
Page 1 of 17 12311 ... LastLast
Results 1 to 10 of 164

This is a discussion on Blocking ads and hiding page elements within the Chrome Plugins section, part of the Google Chrome category: Browsers and advert blockers (Note: Also have a look at my 4th post below; Blocking ALL ads easily in Chrome ...


  1. #1
    Michael3185 is offline Senior Member
    Join Date
    Apr 2009
    Location
    Lincoln, UK
    Posts
    377

    Default Blocking ads and hiding page elements

    Browsers and advert blockers

    (Note: Also have a look at my 4th post below; Blocking ALL ads easily in Chrome.).

    A lot of people are confused about advert blocking in Chrome and other browsers, so for those who don't find the subject clear, here's some simple help. Adblock+ for Chrome is written by Lex1. The script/.crx file and information can be found in another thread, linked to at the end of this post.

    For some time I've been trying out different ad blocking tools, in different browsers as well as Chrome. I wanted to know just what was going on, and what options are available at the moment (as opposed what might be available 'somewhere down the road'). For those who aren't sure about ad blocking, here's what I found.

    When most people use the name Adblock+ they're referring to the Firefox extension, Adblock Plus. The Adblock+ discussed here is not the same thing. In Firefox, Adblock Plus can stop ads from loading, and also has a companion extension called Element Hider which lets you remove annoying things from web pages you visit. It has a context (popup) menu which allows easy selection and ad blocking, and uses lists provided around the web of nasty sites to block. Adblock Plus stops ads before they load, which speeds up browsing slightly and saves a little bandwidth as well. It's not available for Chrome yet.

    Opera has a 'Block content' popup menu, but it hides elements rather than blocking content from loading. It also only seems to allow hiding of images and videos, not text ads or blocks of text. Opera can also use a content blocking list in the form of an .ini file, and so does some of the job of Adblock Plus on Firefox, but not as easily for non-technical users.

    Google Chrome has three versions; Stable, Beta, and Development (Dev). There are other threads about how to get each version, but if you just downloaded Chrome from a 'normal' link, you're probably running the Stable release. (If you want to run scripts you'll need the Beta version, and for .crx (packed) extensions you'll need Dev. This Adblock+ is available as both script and .crx file).

    To confuse things further SRWare's Iron browser, which is developed from the same Chromium Open Source project Google Chrome is, can also block ads. But it does it differently of course (I can just hear Sinatra singing, "I did it myyyyy way"...) Iron has 'extensions enabled' and uses an .ini file containing a list of sites to block before content loads, similar to Opera. It works, but strangely, Iron doesn't load .crx extensions. It will run the script version of this Adblock+ though.

    How to use Adblock+ (with a nod to other blockers)

    You can use this script/extension with Chrome and Iron, and possibly Chromium (I haven't checked). If you use the script version you don't get the snazzy tools in the bottom of the browser window that you do with the .crx version, but it works fine. I should say here that this Adblock+ is not a content blocker; it's an 'element hider'. This means that it gives you the option to hide things after they've loaded. It happens so quickly that you don't usually see the things you've blocked again. If you made a mistake you can unblock them again too.

    Using it is very simple. Pressing Alt+B (or using a tool button in the .crx/Dev version) allows you to mouse over offending page items and select them for hiding. Alt+W pulls up a more compact 'element background' filter. Alt+E allows filter editing, Alt+T undoes the last hide, and Alt+U undoes all hides.

    To get the quickest and best results you should mouse over the edges of a block/box on the page to hide it's container and make the page to look tidy afterwards. When you left-click, a small dialog appears which contains the string used by Adblock+ to hide the element. For example, one site I use has a 'Job of the week' block which I don't want to see. It shows text and an image, and has a container to hold them. This is done in the page's HTML with a DIV block. Clicking the edge of the container after pressing Alt+W I get the following in the Adblock+ dialog;

    HTML>BODY>DIV[id="container"]>DIV[id="wrapper"]>DIV[id="adWrapper"]>
    DIV[id="mainContent"]>DIV[id="holdingdiv"]>DIV[id="jobOfTheWeek"]

    Now I want to block this on every page of the site, but I don't know whether it's going to be written in exactly the same HTML on every page. All I need to do is hide the container by its DIV ID, so instead of clicking OK in Adblock+ I change the above to;

    DIV[id="jobOfTheWeek"]

    Anywhere in the site that a HTML DIV container exists with the ID 'jobOfTheWeek' it simply won't show on the page.

    Another neat way to do it is to right-click a page element and select 'Inspect element' from the popup menu. Look through the HTML around the element in question, and find what 'holds' it. Then use Alt+E to edit the hiding filter(s) and add the string to the end (after a comma separator), eg., ',DIV[id="WeeklySale"]'. Filters appear in a tiny dialog when editing, so copying it into a text editor, modifying and then pasting back is the best bet once they become a bit lengthy. (Adblock+ could do with a larger dialog for editing).

    Other blockers/hiders

    The Adsweep script works in a similar way to Adblock+ in that hides elements. It isn't easy to add to though, and support for it has been discontinued.

    If you use Iron for its .ini ad site content blocking, you can just add lines to the .ini file and restart the browser. For example, if you see ads on a site which are linked to from http;//these.duff-ads.com, you just add .duff-ads.com to the list and none of their ads are loaded in future.

    If you prefer to download regular Chrome updates then you could use BFilter (see later post) or Privoxy to block ad content from loading, and Adblock+ to hide other elements you don't much like. Personally, I found and Privoxy too complicated to bother with, and the hosts file option using Hostsman slowed my machine down terribly.

    Google say that Chrome will soon have proper extension support, which should give the ability for true content blocking. For now (and in fact even when content blocking is available) Adblock+ does a superb job, though it perhaps should have been called HideContent to save confusion.

    Adblock+ is available in this thread. (If you want the User Script version, go to the link at userscripts.org and then click the Source Code tab at the top of the page and copy the script content into a file).
    Last edited by Michael3185; 10-22-2009 at 09:13 AM.

  2. #2
    sulasno's Avatar
    sulasno is offline Super Moderator
    Join Date
    Sep 2008
    Location
    Bangkok
    Posts
    1,759

    Default

    thanks for sharing
    will stick this thread temporary

    EDIT
    would be great to include links to download the extensions, etc, and credit to the creator

    EDIT
    also for consideration in the blog section
    Last edited by sulasno; 10-04-2009 at 11:34 AM.

  3. #3
    Michael3185 is offline Senior Member
    Join Date
    Apr 2009
    Location
    Lincoln, UK
    Posts
    377

    Default

    Thanks Sulasno. (There's a blog section..? I'm off to find that).

    Adblock+ is very neat indeed. Again for beginners, I've just been experimenting with YouTube as I don't like to see most of the junk it puts all over the pages - i just want to watch the videos. So I did some Alt+W ad selecting, then edited the suggested rules from Adblock+, and cleaned up the page with the following (use Alt+E to add/remove rules as you choose);

    DIV[id="feedmodule-PRO"],
    DIV[id="feedmodule-TOP"],
    DIV[id="side-announcement-box"],
    DIV[id="homepage-whats-new-block"],
    DIV[id="ad_creative_2"],
    DIV[id="iyt-login-suggest-side-box"],
    DIV[class="search"],DIV[class="links"],
    DIV[class="region-and-language-pickers"],
    DIV[id="chrome-promo"],
    DIV[id="watch-this-vid-info"]

    Note: these must all be on one line in Adblock+'s Edit dialog.

    Good stuff, Lex1.
    Last edited by Michael3185; 10-04-2009 at 04:30 PM.

  4. #4
    StevePaul's Avatar
    StevePaul is offline Senior Member
    Join Date
    Mar 2009
    Location
    Birmingham, England
    Posts
    1,522

    Default

    @Michael3185

    Excellent 'tutorial' ...

    Btw I thought you were leaving ;-)

  5. #5
    Michael3185 is offline Senior Member
    Join Date
    Apr 2009
    Location
    Lincoln, UK
    Posts
    377

    Default

    Quote Originally Posted by StevePaul View Post
    Btw I thought you were leaving ;-)
    I often leave things - sometimes for days at a time!

    To be honest, there just isn't anything to compete with Chrome for me. The latest Firefox Dev is very fast and has a stack of wonderful extensions, but still seems clumsy by comparison. Same for Opera 10; very fast and nice looking, but doesn't do the job. And while Safari might be cool on a Mac, it lasted perhaps five minutes on my Vista laptop.

    Whoever designed the pure simplicity of Chromium, the lack of clutter, menus, tool bars and status bars, etc., it was genius. The funny thing is that while so many people have been really into themes which change their browser's interface, and tons of extensions which clutter it up and slow it down, once they've used Chrome they say things like, "OMG - why hasn't it always been this easy?"

    And this is the best site for all things Chrome.

  6. #6
    Michael3185 is offline Senior Member
    Join Date
    Apr 2009
    Location
    Lincoln, UK
    Posts
    377

    Default Block ALL ads easily in Chrome

    In case this is of help to any other non-techie users of Chrome who love it but hate ads...

    I've edited this today, as I was using Proximodo in Vista to block ads and other annoying content before it got to the browser. Proximodo crashed a few times though, so being the intrepid nerd I am, I hunted down and tested a few other proxy server programs.

    The name 'proxy server' puts off a lot of non-techie people, no doubt making them feel that it's going to get horribly complicated, and perhaps leave them with an unusable machine. Some of them are complicated, but BFilter is so easy to set up and use it's ridiculous - and it works.

    Just download and install it, and select 'Yes' to run on Windows startup. Follow the simple instructions for Windows Internet Settings to set the LAN to Proxy at 127.0.0.1 and Port 8080. Done.

    BFilter doesn't require huge filter files as it uses pattern matching. Clicking the system tray icon opens a dialog with various settings, and shows you the filters. You can edit 'local.urls' (meaning your own filters) in Advanced Settings. For example, one site I use frequently connects to another for stats or something (I don't know what) and after mostly loading a page it sits there waiting, and waiting... The site it's trying to connect to shows as http;//thisis.co.uk, so to kill that behaviour I just added this to the local.urls section;

    AD *thisis.co.uk/*

    It now loads pages instantly and stops egg-timing at once. How easy is that..?

    If you install this you can use Chrome ad free, and not give any thought to whether it ever gets a content blocker: you won't need one. Adblock+ takes care of the other minor annoyances. Result; happy browsing. (Although if you like tinkering with stuff, I have to admit that it gets a little boring as everything just works the way you want. Time to look at ad-block pattern matching just for the hell of it...)
    Last edited by Michael3185; 10-05-2009 at 08:02 PM.

  7. #7
    mg2's Avatar
    mg2
    mg2 is offline Senior Member
    Join Date
    Jun 2009
    Location
    Karlsruhe, Germany, Europe
    Posts
    328

    Default

    I need help, I very much like Adblock+ but I hate the toolstrip, is there any way to disable it, even by removing some code manualy from the extension? If not please give me a link with a older version without the bloody toolstrip!

  8. #8
    Michael3185 is offline Senior Member
    Join Date
    Apr 2009
    Location
    Lincoln, UK
    Posts
    377

    Default

    @mg2

    You can show and hide it with Ctrl+Alt+B I think - check the main Adblock+ thread.

    If you use the script version as I am in Chrome Beta, you don't see a tool strip. (Does kind of ruin Chrome, doesn't it..?!)

  9. #9
    alinescoo is offline Member
    Join Date
    May 2009
    Posts
    83

    Default

    I have tested BFilter and I don't have too many good words about it. I even converted the adblockplus easyList subscription to BFilter compatible. And guess what, it doesn't even block google ads here on forum... what kind of adblocking is this if it doesn't block the most common ads ? So, bye bye BFilter.

    It's interesting how they say they make the fastest browser in the world and don't offer content policy for blocking ads before page load. Firefox browsing with AdBlockPlus extensions leaves Chrome in dust with all it's speed. Speed isn't anything, browsing plaisure should be the main scope of chrome. If Firefox would have faster startup times and would feel a little lighter, I bet that nobody would ever look at Chrome...
    Last edited by alinescoo; 10-09-2009 at 06:13 AM.
    WPF tutorials for beginners. Even some N-tier here

  10. #10
    Michael3185 is offline Senior Member
    Join Date
    Apr 2009
    Location
    Lincoln, UK
    Posts
    377

    Default

    @alinescoo

    BFilter blocks the ads here for me. In fact, it blocks all ads - I see none, ever. The standard rules are set to block a lot of content, but adding a huge list isn't what you need to do. Put these in your urls.local (under Configuration->Advanced);

    ALLOW *.flv
    AD ++ /ads.*
    AD *googlesyndication*
    AD *doubleclick*
    AD *revsci*
    AD *tzuy.*
    AD *histats.*
    AD *intelli-direct.*
    AD *shareasale.*
    AD *addthis.*
    AD *quantserve.*

    Anything you put there takes precedence over other rules, and *site.* stops all connection to a site, so you can get rid of annoying lags to stat sites and such. BFilter is the best filter/blocker I've found out of all of them because it's small, very fast, doesn't need huge lists, and is very easy to add site blocking to. Don't slam a huge list in there and hope it'll block things -use your noggin and block things your way.

    I agree with you regarding Chrome and content policy, and so do a few million others! It's pretty obvious, really. Google make huge amounts of money from advertising, and know very well that if they allow ad blocking right away then advertisers will leave, and they'll loose tons of money. I know software engineers who write complex systems for Windows, and they say content policy could easily have been added from the start.

    Personally, I think Google will keep delaying it, or make it so that ad blocking isn't as easy to add in the way of Firefox. I may be wrong, but only time will tell. I don't care now, because BFilter does the job exactly as I want, stopping all lagging connections and adverts. Whether or not Adblock Plus comes to Chrome is irrelevant to me now because I already have it!

    On a similar note, I was using Lex1's Adblock+ script to hide content I didn't want to see (ie., not ads, just things like the ridiculously huge logo on this page). Sadly, Adblock+ kept loosing its settings, so I ditched it and now use a very cut-down version of Adsweep, which has only a few rules of my own in it. All works wonderfully, and Chrome does run like lightning as it's meant to.
    Last edited by Michael3185; 10-09-2009 at 08:31 AM.

Page 1 of 17 12311 ... LastLast

Similar Threads

  1. Q: RE: theme manifest.json file required elements
    By jstalnak in forum Themes Development
    Replies: 9
    Last Post: 03-02-2010, 03:38 PM
  2. Full ad blocking, and fixing Iron
    By Michael3185 in forum Chrome Tips & Tricks
    Replies: 3
    Last Post: 10-17-2009, 10:48 AM
  3. Hiding the URL strip
    By Luc VN in forum Chrome Talk
    Replies: 0
    Last Post: 09-19-2009, 02:06 PM
  4. Need Ad Blocking Extension!
    By voidpointer in forum Plugins Development
    Replies: 28
    Last Post: 09-03-2009, 02:20 AM
  5. Replies: 1
    Last Post: 03-14-2009, 02:49 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •