An alternative implementation of OperaPythonAdblock in blazing fast C++.
Update:
Opera has an adblocker now, so CPP adblock is no longer needed. The linked files no longer exist on that site either.
However, all the old files are here just in case you want to look at them.
Note: This is really meant for Opera < 9. Opera 9 supports href selector matching differently, which breaks some functionality that cpp_adblock relied on. Plus, current versions of Opera have a built-in content blocker that makes this obsolete. Also, the last update of cpp_adblock has a very old menu ini file that's probably not compatible with newer versions of Opera anymore. So, basically cpp_adblock is of no use unless you want to fiddle with it and Opera 8.x or the very early 9.0 betas etc.
Update: cpp_adblock-v.05beta2
Got rid of the data uri method for inputting filters and styles in the address bar. Now, the add style/filter page is an actual html file and uses an input box, which means you don't have to worry about escaping certain characters. Updated install.txt to reflect the extra file.
Also, fixed the cpp_adblock binary so it won't add a duplicate entry to adblock.css.
Also, put remove directions in adblock.css and filter.ini
Update: cpp_adblock-v.05beta1.
This version has ~52 adblocking entries added to the default menu, which means there are a boatload of blocking options. This version now supports adding to filter.ini when you collapse something with certain css options. You can also manually add and remove entries from filter.ini and adblock.css. It supports CSS substring, prefix, suffix and absolute attribute selectors. Plus, you can add your own. If you do not like how the commands are set up, just edit the included menu to your liking.
The zip file contains win32 binaries, linux binaries, source and directions. If on linux, just install unzip so you can extract the files.
I've been testing this version on both WinXP? and Debian Woody and it's working great.
You want to use this with OPera 9.0TP1 or newer to get the most out of it.
Update: Here's a new adblock menu that I'm testing for cpp_adblock that's made from Opera 9.0TP1's default menu. This one has support for matching via a substring of a source (because Opera 9 has support for some CSS3 selectors now). There are a whole bunch of different blocking options under the hotclick popup menu now; including blocking via css signatures. (Comment out the ones you don't want to use). Just like before, you need to edit the menu and replace each instance of %appdata% with the path to your application data directory that the cpp_adblock directory is in.
Also, there's a new overlay.css included that now overlays img elements too.
I also added an "add style" option to the adblock menu. When you click on Adblock -> "Add style", it opens up a new page with a blank plain text data uri. Type the path or partial path after the comma in the address field and hit enter. Then, the text will appear on the page where you can then select it and use the right-click menu to add it to adblock.css with the rule of your choice. Again, you can comment out rules you don't use by editing cpp_adblock_menu.ini. You can also add your own rules. Just look at the existing commands in the ini file as a reference.
Since the whole process is dependent on the menu commands and overlay.css, you can customize it to how you like it.
Download: C++ Adblock v.04
This one uses an installer to handle *some* of the installation and has a few improvements. See included change log. It works fine for me, but just in case, v.03 is still available.
(Directions for installing are included in the zip file)
Download: Alternate version of v.04
This one is for installing directly to the opera directory and is much simpler to setup.
Download: Linux version of v.04
Should work the same as the others, but it's not tested on linux. You have to build the program first for one, but you may also have to tweak the program to get it to work as it may not be right. Feel free to fix it and update the page.
Download: C++ Adblock v.03
Note: Because of a possible bug (bug-168565 for review) in Opera 8, you may not be able to block URIs that are long enough to cause the length of the command, that Opera uses to load cpp_adblock.exe, to be longer than the limit for your OS. If you try to, Opera won't execute cpp_adblock.exe and will just show an out of memory error.
On WinXP? and Server 2K3, if Opera is using the proper method to load executables when you use the 'Execute program' command, the command limit is 2^15. On earlier OSs, the limit is much smaller.
For win98, the best bet would be to put cpp_adblock.exe in c:\ and put your style sheets in c:\styles. Putting cpp_adblock.exe in c:\ will shorten the length of the command used to load cpp_adblock.exe. (You'll need to adjust all the paths in the cpp_adblock_menu.ini and the paths to the css files in Opera6.ini to match the new locations). Also, for the 'block this src' command, you can trim it down to just *[src='%c'] so the command will be even shorter, which might help a little.
(Do note that this might not be a bug, it might be Opera's way of not even trying to execute a command that is longer than the limit for the OS.)
CategoryOpera
CategoryTechnical
Is it possible to use wildcard characters? I have tried using * , but it dosen't work. It's kinda annoying to block every image and block all new ads that come up.
80.202.31.203 (2005-05-22 01:00:05)
Wildcards are not possible untill Opera supports CSS3 attribute selectors.
134.58.253.130 (2005-05-22 16:45:42)
You may want to tar the files meant for Linux specifically for 'nixes as the directory representation \ (backslash) is wrong and should be / (forwardslash) for 'nixes. As it is extracting the archive in linux results in the following filenames (and no directory):
#> tar -xzvf cpp_adblock-v.04-linux.tar.gz
cpp_adblock-v.04-linux\\adblock.css
cpp_adblock-v.04-linux\\adblock_funcs.h
cpp_adblock-v.04-linux\\cpp_adblock.cpp
cpp_adblock-v.04-linux\\cpp_adblock_menu.ini
cpp_adblock-v.04-linux\\cpp_adblock_remove.cpp
cpp_adblock-v.04-linux\\install
cpp_adblock-v.04-linux\\overlay.css
#> ls
cpp_adblock-v.04-linux.tar.gz cpp_adblock-v.04-linux\cpp_adblock_menu.ini
cpp_adblock-v.04-linux\adblock.css cpp_adblock-v.04-linux\cpp_adblock_remove.cpp
cpp_adblock-v.04-linux\adblock_funcs.h cpp_adblock-v.04-linux\install
cpp_adblock-v.04-linux\cpp_adblock.cpp cpp_adblock-v.04-linux\overlay.css
69.162.50.12 (2005-09-08 16:54:32)
Yep. And it doesn't even work. I compiled it, installed it per the instructions in the 'install' file, and it doesn't work. Opera just says this:
Open file
cpp_adblock
with
kfmclient exec
Regardless of whether I click Yes or No, nothing happens. And now, ladies and gentlemen, I am going back to Mozilla Firefox.
80.221.35.24 (2005-10-13 23:12:09)
Sorry for not checking the comments.
I edited the page to show that the directions are in the zip file.
As for the linux version I can't test it right now, so if someone can fix it, let me know.
As for the linux version being zipped up. I can change that, but last time I used debian woody, I had no problem extracting zip files because I had unzip. Until I'm running linux again. (may be a long while), I won't be able to mess with the linux version.
burnout426
BurnOut426 (2005-10-19 11:53:41)
So. Opera 9 TP1 supports Css3? selectors- will it be possible to update the Cadblock?
217.19.208.18 (2005-10-24 05:42:20)
Yes
BurnOut426 (2005-11-02 09:25:56)
Linux version works for me, only annoyance is not having wildcard support.
One thing not mention in the install i think makes a difference is setting your style sheet to adblock.css
goto tools->preferences->advanced->content->style options->choose
and browse to where ever you stuck the file.
also make sure you put the full path, not relative or ~/ etc type paths, has to be full path to your cpp_adblock, cpp_adblock_remove and overlay.css.
68.197.125.18 (2005-11-03 13:31:41)
BurnOut426 (2005-11-06 19:19:27)
It's doesn't work for me totally. I tryed to block image and it apears again after refresh of page. Why it so?
213.148.162.182 (2005-11-13 03:16:14)
BurnOut426 (2005-11-13 05:01:38)
I'm at loss on changing adblock_cpp_menu.ini path.
On your installation note it says to replace %addblockdir% to my selected path. I'm using portable opera and would like to retain the adblock menu regardless where I copied opera on host computer. What should replace %addblockdir% in my case ?
Thanks for your effort creating this.
61.94.120.45 (2006-01-07 22:11:11)
the adblock menu did show up, but when I right click on image and choose "block", there is popup windows says : "File Not Found"
61.94.120.45 (2006-01-07 22:20:36)
There´s anyway to put the 'Adblock' menu before Opera´s 'Help' menu?!
201.12.136.154 (2006-01-12 14:38:57)
For the one who asked about portable Opera, I don't have an exact answer. You have to replace %addblockdir% with the path of the adblock directory on your flash drive. However, since the drive letter will be unknown and the menus don't support environment variable, I'm not sure you can even set up a path that would work all the time. (Unless you can use \ as the root of the flash drive.
BurnOut426 (2006-01-16 01:21:11)
If you get a "file not found" message, that means one or more of the paths are not set up correctly in the menu file.
To put the Adblock menu before the help menu, move Submenu,
"Adblock", Adblock Menu
above the help submen.
I can be reached at gmail via shadow2531
BurnOut426 (2006-01-16 01:26:12)
Note:
Since Opera 9 css selectors properly support matching of attributes values of type URI ( they now matche exact values like FF instead of resolved ones like they used to ), cpp_adblock probably won't work right with Opera 9.
(Well, it will work right, but the selectors added to adblock.css won't match a lot of URIs now.)
No plan to update cpp_adblock to fix this as Opera has its own adblocker now.
However, feel free to update it yourself if you really want to use it.
BurnOut426 (2006-11-05 10:20:01)
q1a128
210.246.145.164 (2008-05-17 20:05:15)
не скачать cpp_adblock-v.04.exe - выдаёт "страница не найдена"...
92.100.72.160 (2008-05-18 08:48:33)
nice site dude
216.35.68.197 (2008-05-19 16:08:03)
tickets_3.txt;2;2
59.95.18.11 (2008-06-05 00:37:08)
tickets_4.txt;2;2
203.162.2.137 (2008-06-05 03:46:32)
tickets_5.txt;2;2
61.86.48.151 (2008-06-05 07:02:56)
Hi. I really think that I followed the instructions to the letter but there is no sign of any "adblock" anywhere (Opera 9.5 Win XP Pro SP2). I appreciate that you have gone to all this trouble and it probably is my fault (it's quite late)but if the user can't get it to work, then it's all to no avail - in my case I will just uninstall and revert to Firefox. What about a full installer that just "does it all" - perhaps someone could volunteer?
198.54.202.130 (2008-06-16 11:09:00)
vi6WwX spam_15.txt;5;10
64.62.138.39 (2008-09-06 17:40:46)
Vhinvj spam_31.txt;5;10
190.49.35.141 (2008-09-06 18:42:24)
good post man thx
221.241.160.111 (2008-10-19 05:49:24)
this shit doesn't work anymore, don't waste your time ...
24.232.78.180 (2008-11-09 04:09:59)
"this shit doesn't work anymore, don't waste your time ..."
Added a note up top so no one wastes their time.
BurnOut426 (2008-12-20 07:01:13)
aeWUdj yxzdpmgr oukzutwc nvztxwjr
89.248.172.50 (2009-07-27 19:53:51)
fdcxqemn frjjpnth rczerufb
95.169.190.71 (2009-07-31 18:32:37)
nwysvbvl uqecleez lmwzslve
95.169.190.71 (2009-07-31 19:52:23)
mbjjzupm cotlieii kslzxdln
95.169.190.71 (2009-07-31 21:12:55)
hapwbeys zfplycjl naddrddc
95.169.190.71 (2009-07-31 22:34:20)
prgsmauc efsjyhlg rdnrjtlq
89.248.172.50 (2009-08-09 06:42:22)
nfektbut gesawnmh acvbwjxx
89.248.172.50 (2009-08-09 08:08:49)
xsdjeshl crjkzidl ggzxkzql
89.248.172.50 (2009-08-09 09:33:08)
fzawhxux dynoznia ylvclppq
89.248.172.50 (2009-08-09 10:56:32)
epkoetlf goadpeuc imfyngtu
89.248.172.50 (2009-08-09 12:19:52)
jhbisizw nltxtdiq vakzyohj
94.102.49.213 (2009-08-14 00:49:59)
fbvdaykn mpjehinn wuvnralc
94.102.49.213 (2009-08-14 02:14:10)
xxcygfyt utfjcrpf imvgijfo
94.102.49.213 (2009-08-14 03:37:46)
jibvgvdo gfoglcsb qhqzzcfh
94.102.49.213 (2009-08-14 05:01:32)
drzukctf ouaoxyoi wyieippb
94.102.49.213 (2009-08-14 06:28:49)
yabaoija auyibtaz jzegunkw
94.102.49.213 (2009-08-14 07:56:01)
iqnqzeyc eyjfpwhe cyvxycom
94.102.49.213 (2009-08-14 09:23:58)
braqhwno aeddbuqv iafpyndg
94.102.49.213 (2009-08-14 10:50:06)
jltyeczq rpjreosn paoqzyyf
94.102.49.213 (2009-08-14 12:13:13)
dyddysdn pttwbwpr nxodocnf
94.102.49.213 (2009-08-14 13:36:12)
cbxrcvca ddnqdrmp npdslhvz
91.121.84.111 (2009-08-17 21:43:57)
btcvctur sybrricj kpdlsspc
91.121.84.111 (2009-08-17 23:24:06)
tzzioklt vcgtgiyt qlpdgqzq
91.121.84.111 (2009-08-18 01:04:25)
trjkepns ltrscakd luxtszyz
91.121.84.111 (2009-08-18 02:46:46)
ghgaktcq dhwyrexz qxodnsha
91.121.84.111 (2009-08-18 21:01:05)
jfbxrogv utacultj zxmacnem
91.121.84.111 (2009-08-19 01:48:20)
lfgwllcw jolwymqk rgcoduno
91.121.84.111 (2009-08-20 17:10:34)
siflbjmz lxkbfaxl fqjkoddx
91.121.84.111 (2009-08-20 23:09:05)
yxtvkmpm zftmjbhq tqrtaetz
91.121.84.111 (2009-08-21 05:05:55)
fdyamvqw mahzewyv mbsspsrt
91.121.84.111 (2009-08-21 11:04:57)
bvsukrzn xlidyyvf luweiujg
91.121.84.111 (2009-08-21 15:30:40)
jzagiejt mxcvglmd lrcsgley
91.121.84.111 (2009-08-21 21:28:31)
zwwtkqvg evtmelcc cflmenqw
91.121.84.111 (2009-08-22 10:05:22)
btggzfws jfexvxym ggqtdlkr
91.121.84.111 (2009-08-22 11:48:47)
pwcdshkm ipcmjtcx hmfiolpy
91.121.84.111 (2009-08-22 13:34:33)
mmsyvuxy ixbkhtey unflxrvd
91.121.84.111 (2009-08-28 13:28:45)
lsztsvxi qyfehhpz xbzzrsvd
91.121.84.111 (2009-08-28 15:05:56)
nsggalqq pogmbaun oewtnzek
91.121.84.111 (2009-08-28 16:44:11)
dbqgricw rtzzynco zhglvvus
91.121.84.111 (2009-08-28 18:23:31)
zmubjdre gdhsdoga rcjagycs
91.121.84.111 (2009-08-28 20:05:25)
jixnccfu lfuihqhz pvzadmwk
91.121.84.111 (2009-08-28 21:45:05)
ahhqmwbv tzbqlpzl jbgrusfb
91.121.84.111 (2009-08-28 23:22:23)
tuzjvzjl ayyupbvr tringsgr
91.121.84.111 (2009-08-29 00:59:21)
zfndouwj opmnaoii kpgupxlg
91.121.84.111 (2009-08-29 02:37:42)
cysrknug bgmgrajv jvgrtdfk
91.121.84.111 (2009-08-29 04:16:52)
doors.txt;10;15
218.183.224.146 (2009-09-15 06:11:52)
Hello! bfkkgda interesting bfkkgda site! I'm really like it! Very, very bfkkgda good!
83.39.55.73 (2013-01-20 18:07:14)
Very nice site!
118.163.33.91 (2013-01-20 18:08:17)
Hello! ebbecbe interesting ebbecbe site! I'm really like it! Very, very ebbecbe good!
87.98.131.201 (2013-01-20 18:08:26)
Very nice site!
88.212.35.118 (2013-01-20 18:09:34)
Hello! dcbadbk interesting dcbadbk site! I'm really like it! Very, very dcbadbk good!
87.230.54.88 (2013-02-10 12:32:12)
Very nice site!
213.144.132.98 (2013-02-10 12:33:35)
Hello! edeafeg interesting edeafeg site! I'm really like it! Very, very edeafeg good!
203.160.182.100 (2013-02-10 12:33:52)
Very nice site!
74.84.9.1 (2013-02-10 12:35:57)
Hello! dfbgfbe interesting dfbgfbe site! I'm really like it! Very, very dfbgfbe good!
38.102.29.210 (2013-03-01 06:58:22)
i'd suggest making a comment somewhere: "manual included in zip file"
because without it someone can spend much time looking for it, when it sits safely in the zip file
83.31.35.39 (2005-04-27 13:50:54)