Look here if you want ad blocking in Opera


Recommended Posts

OK, it's probably been posted before but one more time won't hurt, and besides i haven't seen a comprehensive guide on it in one post so...:

FX users have adblock and are happy with it. For various reasons Opera Software is unlikely to bundle an adblocking feature so we have to make one ourselves.

As far as i know, there are 2 main steps to adblocking in opera. one is through use of the filter.ini file, which basically cancels all connections to specified servers in the file (if you have heard of windows\system32\drivers\etc\hosts file tinkering, it does sort of the same on an OS level, so i think it's too drastic but it's still not going to cause problems if you have it on)

the other way, much more interesting and powerful, and approaching the niceness of FX's adblock, is through use of custom css.

1. Filter.ini way:

easiest is to get the opera filter prog from http://www.monroeworld.com/operafilter/

run it and it will ask for your opera6.ini file (main opera config file in use, you can find its location by going to help > about in Opera). then it will create a filter.ini file for you in your user profile folder. there's a function in the ad filter prog. - go to internet > get our ad server list and it'll download a fairly big list already. otherwise, as long as you keep the program open, you can right-click any image, copy its link and a window pops up asking you to add this path to the filter.ini

things to keep in mind: every time you update any of opera's ini files, changes will take effect only after a restart of the program.

disadvantages to method: it requires you to keep an extra prog running, so i advise getting the list from the program update feature and not bother with it anymore, it is fairly comprehensive already. also the opera restart requirement.

2. user.css way:

disclaimer - i know nothing about programming in any computer language, i probably couldn't even make a css file to make the text of a page bold. all info here i have gotten from many opera fansites and the credit goes to the people who made those css files, but unfortunately whose names i cannot give. hope they'll forgive me ;). hence anything i say about css is not necessarily true, feel free to correct me.

for newbies - what is css? you have a webpage and you open it in a browser. it looks in a given way. if the webpage creator decided to, e.g. change all text on the page to, say, appear on the right of the pictures on that page instead of on the left, instead of rewriting the html code he can add a css file that'll tell the browser to take that initial page and transform its appearance as stated in the css file (in case you were wondering why everyone is going on and on about IE's poor css support - it tremendously helps managing webpages and changing their looks quickly). this is a very basic way of thinking aboutcss, i know, but it serves the purpose of adblocking

so here's how to do it: you know where your profile folder is already (if not, go to help >about in opera and look at the "opera directory" line - that's it. go there, and open the folder "styles". get the file i attach to this post (it's my user.css minus 2 paragraphs), and place it there.

this is an adblocking css that will attempt to hide ads and collapse them (without it, the filter.ini method or the windows hosts file method will leave a white space where the ad used to be). in a way, if you will, filter.ini stops the content from loading on the computer, and user.css hides the empty space left over - may be wrong, but is a good enough explanation for me.

now, go to opera prefs - page style and choose default mode - user mode. click "configure modes". author mode - tick 1,2,5 options and user mode - tick 1,2,3,5 options.

right-click any toolbar, customize and drag the button from section "browser view" to a toolbar of your choice so you can turn ads on/off quickly by clicking it.

best close opera now, open this post in FX and recheck that all files are as they should be (i.e. check if user.css is the one i posted here and rerun the opera ad filter).

if you with to disable flash content in pages, add this to the end of the user.css file:

embed[type=application/x-shockwave-flash] {content:"Flash"; outline: 1px dotted gray; color: gray; background: black}

embed[type=application/x-shockwave-flash].zichtbaar {content: normal; outline: none}

body:before {

position: absolute; visibility: hidden;

background-image: url("javascript:(function(){window.onclick=function(){var srcElem=window.event.srcElement;var tag=srcElem.tagName;if(tag=='EMBED') srcElem.className='zichtbaar'};})()");

content:""}

(i didn't put it in the user.css because it also makes flash sites unusable unless you click on the "flash" text in them)

and finally, my fave (also paste at end of user.css):

[alt=Get Firefox!], [alt=Get Firefox], [alt=Firefox], [alt=firefox],

[alt=FireFox], [alt=Mozilla Firefox], [alt=Mozilla FireFox], [alt=Spread Firefox],

[alt=Get FireFox], [alt=Get FireFox!], [title=Get Firefox!], [title=Get Firefox],

[title=Firefox], [title=firefox], [title=FireFox], [title=Mozilla Firefox],

[title=Mozilla FireFox], [title=Spread Firefox], [title=Get FireFox], [title=Get FireFox!],

[alt=Get Thunderbird!], [alt=Get Thunderbird]:before {

content:url(http://promote.opera.com/small/opera94x15.gif);

}

^this will replace all webpage buttons advertising FX with a small opera banner. sorry, FX guys, but enough is enough. besides your major goal is to have people move away from IE, not opera :p

hope i didn't put many mistakes in, and enjoy people.

THIS THREAD HAS NOTHING TO DO WITH FX, SO PLEASE NO TROLLING BY FANBOYS. If you use opera, i hope it's useful to you. if you'r ethinking of switching to opera, same. if you're a diehard FX fan, this thread is not for you and you shouldn't be posting crap here. i've seen enough threads in this forum to know what usually happens when fanboys take over - look at the opera vs fx thread - 40 pages of stuff repeated more than 20 times by the same people

user.css

Link to comment
Share on other sites

I like the fact that that CSS is identically to my own custom edited CSS that I made myself built up from the original author's one excluding the last 10 lines... isn't that strange...

Anyway, To make it short:

http://snbx.net/php/viewtopic.php?t=4

Your flash blocker is nicer than mine though. That FF is just plain stupid Opera fanboy crap.

585249909[/snapback]

it is most likely yours, but i got it such a long time ago that i couldn't remember where it was from. there's an author in the comments in the beginning, so i thought that'd be enough credit. i have used google results to find the separate pieces of the css, and opera forums for the anti-fx css. anyways, not taking credit for any but thought that it'd be nice to have smth put together.

to the "illegal" comment: maybe it is, but on the other hand no one is preventing you from wearing colored sunglasses when windowshopping, right? or, on a less farfetched note, change the channel or go take a leak during tv commercials. it's not exactly the same, but after all it is the way i look at the (internet) world and i feel i am entitled to change it the way i wish.

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...

This is a very great thing, and I like it alot, however, the CSS has some problems:

Certein web forms(perhaps all of them) will NOT submit while in usermode(ad-blocking on), and sometimes even require refreshes.

Gmail has the problem, along with Memegens. Curious if this is on my end, or it's just general problem?

Link to comment
Share on other sites

I haven't been paying attention to the forum lately, and probably won't in the future either, but I'm glad I've helped some people with the guide.

Now for the Gmail problem - I personally never had any problems with GMail and the method described here. So it may be a problem on your end... (keep in mind I compiled this mainly from other people's work and don't have the knowledge to edit it a lot, a CSS-knowledgeable person should reply here).

As for some images not showing, I have found that the automated filter.ini update contains certain addresses that prevent my browsing, e.g. i used to have problems with some photos on imdb.com because the image server was in the blacklist. An issue with gamespot.com game screenshots also arose at some point, and i found it to be because the screenshot thumbnails were of a size that is the same as certain banners and as such the css blocked them. The solution in either case, when you notice a blocked item that shouldn't be, is to check image properties of the item - check if address is wrongly in filter.ini, and also check if the picture size is listed in the adblock.css (if so, remove the line concerning that particular pic size). I know it's not as elegant or flexible as adblock, but it's definitely workable. Plus, always remember the user/author toggle button - you're 1 click away from non-css-modified pages.

And enjoy using Opera :) (or Firefox, or IE, or Safari, or Konqueror, or Kmeleon, or Lynx, or...)

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.