Skip navigation.

Bits and Pieces

Opera tips, music, anime, my life experiences.

My Personal Ad Blocking CSS

, , ,

This is the style I use in conjuntion with My Ad Blocking urlfilter.ini to remove "white space'.

Step 1: Go here and find your User CSS directory.

Step 2: Save My Personal Ad Blocking CSS

Step 3: Restart Opera

Step 4: Select Ad Block: BH from the View > Styles menu.

OPTIONAL: Here's a button to call the button

Multimedia Controls in OperaFukken Saved extension for Opera

Comments

LorenzoCelsi 21. February 2008, 10:53

You know using CSS you don't block anything, you just hide it.

BleedingHeart 21. February 2008, 11:42

If the image/embed or the element containing the image/embed are blocked Opera does not download or display the image/embed/element that for me constitutes a block.

Theres some debate regarding this and I've yet to see an official comment from Opera ASA but the tests I've done support this (Packet sniffing, cache monitoring).

Of course this varies depending on browser, Firefox for example simply hides the image/embed or at least that was the case when Stylish users were requesting Opera style CSS "blocking".

Of course for me the CSS blocks are used mainly to clean up containers left behind after I remove them using My Ad Blocking urlfilter.ini. So either way the CSS achieves what the urlfilter can't achieve on its own.

LorenzoCelsi 21. February 2008, 12:29

You can make this simple test.
1. empty your browser cache.
2. load a page with "CSS-blocked" objects.
3. see what is in the cache (of course you can't find containers, only images, JS external files, etc)

I don't know ANY way to tell the browser "do not load this object" via CSS. From what I know you can only change the "display" property.

To block objects you must use the "ini" file, otherwise it would not make sense to add the "block content" feature to Opera, which does not write any CSS for the obvious reason that would not block anything.

Same for Firefox, you need the ADBlockPlus extension to block objects from loading, using CSS you can only hide elements.

BleedingHeart 21. February 2008, 12:36

I have done these tests as well as packet sniffing, when an image/embed is "blocked" (display:none) Opera makes no attempt to download the image/embed. Its not in the cache, when the CSS block is removed (from the style menu) Opera then attempts to download the image/embed.

This is done using the display property, I class this as a successful block.

This is not so much a CSS thing as a browser choice, your simple test and packect sniffing say Opera "blocks" using display:none.

To block objects you must use the "ini" file, otherwise it would not make sense to add the "block content" feature to Opera, which does not write any CSS for the obvious reason that would not block anything.



The "block content" feature has been in Opera for a long time just without the shine, perhaps even longer than the custom CSS feature. To suggest Opera wouldn't add features if it meant duplication is certainly strange considering there are several ways to search (address bar, search bar, hotclick menu), several ways to call bookmarks (menu, panel, nicknames, speed dial) several ways to change settings (Preferences, opera:config, .ini file) and several ways to block content (urlfilter.ini, CSS, user JS, proxys).

LorenzoCelsi 21. February 2008, 13:14

Guess what, you are right.

Adding "display:block" stops Opera to load the image.
That is weird in my opinion for serveral reasons but hey, thanks, I've learned something new today :smile:

I never tested the CSS blocking in depth because the ini file technique makes more sense in my opinion since it allows to use more "generic" filters, for example to block external JS files from loading and executing and/or the adservers as root, regardless what comes from there.

I never tried to mix the 2 things mostly because I am lazy and I find already annoying to debug the ini filter.

About Opera multiplicating features yes, you are right and I think it should be re-designed because on one side it allows the user to customize the browser more, on the other side it makes the browser a little cluttered.

Since we are speaking of Opera, I'm having problems with flash objects, it happens that Opera freezes for a while or even hangs when I load a page with things like youtube videos embedded.
Have you ever seen this behaviour?

BleedingHeart 21. February 2008, 13:25

Personally I use the .ini for sites and servers that I want to shut out completely and the CSS for cleaning up the "white space". Plus it tends to get some things that a more generic .ini wouldn't catch although you could make it. :smile:

BleedingHeart 25. February 2008, 14:10

Updated

BleedingHeart 2. March 2008, 02:12

Updated

BleedingHeart 3. March 2008, 05:32

Updated

BleedingHeart 5. March 2008, 05:52

Since we are speaking of Opera, I'm having problems with flash objects, it happens that Opera freezes for a while or even hangs when I load a page with things like youtube videos embedded.
Have you ever seen this behaviour?



On Linux I've seen too many problems with flash to mention, on Windows I've only experienced that when duplicate plugins are detected.

BleedingHeart 5. March 2008, 05:54

Updated

Cleaned up a lot of news and torrent sites.

BleedingHeart 11. March 2008, 13:57

Updated

BleedingHeart 17. March 2008, 05:46

Updated

BleedingHeart 29. March 2008, 16:23

Updated

BleedingHeart 13. April 2008, 06:34

Updated

BleedingHeart 18. April 2008, 06:56

Updated

BleedingHeart 11. May 2008, 08:32

Updated

BleedingHeart 19. May 2008, 19:48

Updated

BleedingHeart 21. May 2008, 07:57

Updated

tambovwolf 25. June 2008, 16:25

Thanks a lot for the CSS!

I don't use .ini, since I am using hosts file for that and it applies to all the browsers, but style sheet is great for removing white spaces left on screen.

BleedingHeart 29. August 2008, 10:25

Np. Updated

rams78 5. September 2008, 08:27

Thanks, that helps a lot.

ZAHEK 11. September 2008, 06:24

Thanks.Really good working.

BleedingHeart 11. September 2008, 11:19

np and thanks guys.

ZAHEK 11. September 2008, 12:02

:cheers:

snf 29. September 2008, 16:43

hi

Thanks.
Very good.

It is possible to add :confused:
Block commercials links inside google search result page.

Thanks.:headbang:

bye


BleedingHeart 29. September 2008, 17:52

Give me an example of one you still see and ill have a look.

BleedingHeart 24. November 2008, 08:10

Updated

BleedingHeart 6. March 2009, 18:59

Updated

Anonymous 16. March 2009, 13:03

Anonymous writes:

adblock.css is blocking too much I think, some sites only load blank pages, I think you are blocking items that represent the entire page layout or am I missing something.

Anonymous 16. March 2009, 20:21

BH (Doesnt Want to log in here) writes:

Well first make sure its the css that is the problem (enable/disable) And then post the sites, I'll see what I can do. It is possible that its happening more and more sites are putting there entire content in div's etc with ID's and Classes such as adbanner etc etc.

espirates 9. April 2009, 23:59

How come Adblock effects this page on craigslist

http://newyork.craigslist.org/rnr/

The navigation links up top disappear when Adblock is used. I looked at the html code and could not find anything that would be listed as an ad since they are just header links.

Any ideas ?

BleedingHeart 10. April 2009, 00:26

No idea, it doesn't block them for me, are you using the latest version of this one?

espirates 10. April 2009, 17:32

You're right, it works now, I wasn't youring your urlfilter.ini, I was using fanboys version.

How to use Quote function:

  1. Select some text
  2. Click on the Quote link

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

If you can't read the words, press the small reload icon.


Smilies