Skip navigation

Lost password? | Help

My program for Opera

AdBlock for Opera - analogue of «Adblock Plus: Element Hiding Helper»

adblock_setup.zip (130Kb)

UserJS-only version: adblock.js (backport from Chrome; use Alt+Shift+B for blocking and Alt+Shift+U for unblocking. Press Alt+Shift+E for editing styles).

This tool used for easily blocking of page elements (and text ads). You simply select the element you want to be block. The element hiding rule is generated and added in Adblock+.css automatically.

Installation:
Copy and select the menu in Ctrl+F12-Advanced-Toolbars. Close Opera, start AdBlock_setup.exe, specify the folder of Opera.
Enable style AdBlock+ in menu View-Style. Install adblock.js as usually.
Now you can block an element from the context menu of page, or having used button AdBlock+.


P.S. Rip.js it's good thing, but the page at first is loaded and only contents then disappear. On my connect, it looks ugly.

Descriptions in opera:plugins and more

Comments

RX8 15. December 2008, 21:34

Thanks, I test it and it works fine. Can you tell me in which file are kept the blocked sites, so i can remove something i put there by mistake.

A.Ruzanov 16. December 2008, 08:41

opera:about->User CSS directory->Adblock+.css

chris34 16. December 2008, 10:46

doesn't work with 10 alpha?

A.Ruzanov 16. December 2008, 11:20

Work without problem.

A.Ruzanov 22. December 2008, 12:20

Update
+ Added support nth-child
- Fixed some bugs

each 28. December 2008, 21:12

This works great-especially after the last update :smile:

Any way to block more than one elements at the same time?
A way would be to hold down a button and clicking on the elements to be removed. When finished the button is released and the popup dialog comes up with all the blocked elements. This is only a suggestion of course (more coming up :smile: ), you can probably come up with something more usable if you do decide to do this.

Also how about giving it more Platypus capabilities like:
1. isolating an element and showing only that
2. widening the element
3. changing the size of the font etc
I don't know if all of these can be done with css, platypus uses javascript.

Of course these are all ideas, if you do however manage to do this then it will be one of the few times that an Opera addon works better than a Firefox extension, as Platypus relies on Greasemonkey which on my last check kicks in only when the page finishes loading.

Anyway thanks again, even if you don't do any of these I use a lot of your other addons already, one of main reasons I managed to avoid switching to Firefox for quite some time :smile:

Anonymous 31. December 2008, 16:12

Anonymous writes:

How to block flash elements??

Anonymous 1. January 2009, 09:52

Anonymous writes:

Many thx for this excellent aid to easy the browsing. I've have the same question, how to block flash driven elements. Unfortunately a click on element produces a divert or pop-up. If possible, check it at next update. Also an integrated edit-function for Adblock.css+ handling (removing unused links after unblock) would be appreciated in the future.

Miladin Miladinoski 2. January 2009, 16:05

How can I make this work on GNU/Linux? :ko:

A.Ruzanov 2. January 2009, 19:10

Any way to block more than one elements at the same time?


Nope.

how to block flash driven elements.


Why you do not use standard blocker for this purpose? Css not the best way for blocking object's.

removing unused links after unblock


?

White_Eagle
Source codes are open. Welcome.

Sk0l 9. January 2009, 00:17

AWESOME! :yikes:

qazokm123 20. January 2009, 01:23

BEST of the BEST .!
with widening and narrowing of element function will be ultimate.

n8chavez 28. January 2009, 22:32

Is there any way to add whitelist capabilities to this. It works great, but there are some sites that look weird with the CSS enabled. Adding them to a whitelist would solve that.

A.Ruzanov 29. January 2009, 11:56

You do not understand something. Css works only on a concrete site, not global.

each 14. February 2009, 20:11

Is there a limit to the number of lines that can be added?
The blocking stopped working after a while. After some testing-
moving the
{ display: none !important }

line up
it seems that the last line that works is 99.
Is that right?And if yes is there a workaround?

A.Ruzanov 14. February 2009, 20:50

Is there a limit to the number of lines that can be added?


Afaik - no.

last line that works


Maybe wrong css-rule? You can copy it here or on my mail?

each 14. February 2009, 22:35

You were right there is no limit it was some bad rules, the ones below which I found throught the error console.
HTML > BODY > DIV[]:nth-child(2) > DIV[]:nth-child(3) > DIV[][] > DIV[][]:nth-child(2) > DIV[]:nth-child(2) > rdf:RDF > rdf:Description > DIV[]:nth-child(5),
HTML > BODY > DIV[]:nth-child(2) > DIV[]:nth-child(3) > DIV[][] > DIV[][]:nth-child(2) > DIV[]:nth-child(2) > rdf:RDF > rdf:Description > DIV[]:nth-child(4),


There were times however when the filtering didn't work without these two rules in the file and it would work again if I reduced the css file to 99 lines,thats why I didn't think to check for bad rules as I checked for file length first.

I couldnt't pinpoint the exact reason, a restart seemed to fix it most of the times or removing a rule with the text editor and readding it throught the GUI.It must be an Opera bug.If it happens again and I manage to reproduce it I will post again.

Father Luke 28. February 2009, 13:55

How come the elements show back up when the page is refreshed?

A.Ruzanov 28. February 2009, 16:57

FatherLuke
«Enable style AdBlock+ in menu View-Style.»

Father Luke 28. February 2009, 22:30

D'oh! Works perfect. Many, many thanks!

- -
Okay,
Father Luke

Piet Piraat 6. March 2009, 21:55

Too bad, these element hiding rules always work globally, not site specific, as they should be.

A.Ruzanov 6. March 2009, 23:04

Piet Piraat
Dude, install adblock.js. After that all rules will include «HTML[class="my.opera.com"] > BODY[id="myopera"] > »

Piet Piraat 7. March 2009, 01:43

Thanks Lex1,

It's quite a hassle to get something working in Opera, I'm sure when Opera would allow easier things like this, and listen to their customers crying for some other stuff like remembering Zoom Levels per site, and something more automatic and easy like AdBlockPlus, Opera would snoop away FF users quite fast, while now its userbase is just dying out....

Anonymous 5. April 2009, 15:42

Aloha writes:

Does it need JavaScript always enabled? Which urlfilter.ini goes best with it? Thank you!

Anonymous 6. April 2009, 06:42

Petr_K writes:

Hallo Lex,
this application doesn't work with new Opera ver. 10 - 1413. An update or advice how to continue using Adblock, would be necessary. Be so kind and check it.

Many Thanks in Advance
Petr - CZ

A.Ruzanov 6. April 2009, 19:05

Updated.

Which urlfilter.ini goes best with it?


If you ask such question, means you completely do not understand for what it it is necessary.

Anonymous 17. April 2009, 20:01

Anonymous writes:

Is there a way to have this button on my toolbar but instead of the Show hidden popup menu text, it would "say" only an icon a blocking sign, you know, a circle with a line through it? That would look nicer.

Anonymous 17. April 2009, 20:38

Anonymous writes:

Nevermind, I managed to do it, the link is:

opera:/button/Show%20hidden%20popup%20menu,%22AdBlock%20Menu%22

A.Ruzanov 19. April 2009, 14:56

How can I make this work on GNU/Linux?


Use UserJS-only version.

Viewy 29. April 2009, 05:36

Been using Adblock on Opera 10 for a while; thank you very much for such a useful script!

Now if someone can fix the paths for the new profile setup in the 1413 build, I'm sure people who like to keep up with the newest snapshots would be very happy. =)

Anonymous 12. May 2009, 00:27

Anonymous writes:


Thanks a million for this fantastic tool, Dude!
Have searched for this for years! Love it, thank you!

Anonymous 14. June 2009, 21:04

MacUser writes:

Thank you, Lex, for what you have done here. It is a shame that Opera doesn't provide Widget versions of Adblock Plus, Adblock, or NoScript. Really, they are so far behind Firefox extensions they are shooting themselves in the foot. Users are way beyond wanting to block entire websites. Websites are too complicated and have too many elements, and if you block the whole site, it becomes unusable.

I need this for a Mac, running an older OS.

I wish there was some user-friendly GUI instead of having to hack it out in files like this, which is great when it's the only solution we have, but not much of a solution compared to Firefox extensions which can be easily installed and uninstalled. Also, on Firefox, my Adblock Plus list of blocked sites (and whitelisted ones) auto-updates every 5 days.

I would like nothing more than for Opera to get its act together and make some official version of NOSCRIPT and ADBLOCK. I would prefer never to use Firefox again as it is a bloated memory hog. To me, Opera's lack of useful widgets reminds me of kiddies playing in kindergarten. Take a look at Firefox's vast list of extensions and compare it to Opera's and there is no comparison.

Get your act together, (official) Opera developers.

Meanwhile, Lex, if you make a Mac version of this, I would be grateful. Maybe it will hold me over until Opera makes an official version.

One more question: In addition to traditional blocking and whitelisting of URLs, scripts and images, do you know if Opera allows for simple blocking of elements?

To be specific, here are some element examples:

!------------------------Element hiding rules------------------------!
##.Ads
##.AllAds
##.FlatAds
##.GOOGLE_AD
##.PanelAd
##.RectangleAd
##.SidebarAd
##.TextAd
##.ThisIsAnAd
##.adlnklst
!~joinmyband.co.uk!!.ads:not(body)
##.ads:not(body):not(\[style="border-top: 1px solid rgb(204, 204, 204); font-size: 13px;"])

Thanks!

Molkio 15. June 2009, 14:26

It's perfect!

Thank you very much my friend.

A.Ruzanov 16. June 2009, 17:39

«if you make a Mac version of this»
-> UserJS-only version: adblock.js

Anonymous 16. June 2009, 23:08

Dude writes:

Does not work anymore with Opera 10.00 beta build 1551 or Opera 'Unite' build. :-(
Is there a way to fix it?

And what about the place where the userjs-only version stores its filtering rules?

A.Ruzanov 17. June 2009, 17:08

Worked without problem.

Molkio 17. June 2009, 17:29

Lex1,what do you think about Adsweep?

Here:
http://spedr.com/2xht3

Anonymous 18. June 2009, 21:03

Anonim writes:

@Lex1.
Opera Unite says 'this extension isn't registred'.

Tom Long 29. June 2009, 21:24

Lex1, where does the UserJS-only version store its settings?

A.Ruzanov 30. June 2009, 08:20

Opera Unite says 'this extension isn't registred'.


Check path for «text/adblock» in Ctrl+F12->Advanced->Downloads.

where does the UserJS-only version store its settings?


In cookies. Opera does not have another store.

Anonymous 11. August 2009, 07:50

Anonymous writes:

where can I locate the registry key for the adblock+ context menu item ?

A.Ruzanov 13. August 2009, 13:29

Opera don't use «registry key». Path to menu.ini is here: opera:config#UserPrefs|MenuConfiguration

Anonymous 14. August 2009, 05:19

Anonymous writes:

Thanks for your help and thanks for adblock+ and flashblock.

Anonymous 16. August 2009, 19:07

Anonymous writes:

Is it possible to re-enable flashblock for a site such as youtube? Tried reinstalling script,empty cache,delete cookies no luck.

Anonymous 18. August 2009, 06:42

Anonymous writes:

please disregard last posting I found my answer here http://my.opera.com/Lex1/blog/flashblock-for-opera-9?startidx=300#comments Anonymous # 25. June 2009, 11:34
Anonymous writes:

but the firefox flash blocker blocks the video in youtube...

Lex1 # 25. June 2009, 20:53
Do not install FlashBlocker-white-list.js
Re-enable userjs in options of the site.

Anonymous 22. August 2009, 18:04

chromax writes:

Hi,

I use opera on an eeePC with Xandros.
The .js is loaded, but without the adblock.css
style it doesn't work.

Anonymous 3. September 2009, 12:24

chromax writes:

got it.

The unblocking "Shift+Alt+U" doesn´t do anything. What should happen normaly?
In the Adblock.js is this keystroke not mentioned...

A little bit more support with an FAQ or something would be helpful.

Anonymous 3. September 2009, 12:30

chromax writes:

For everyone who also not know how to unblock.

Go to: Tools > Advanced > Cookies

Search your blocked site

delete the cookie with the word "adblock" in it.

A.Ruzanov 8. September 2009, 14:25

Update
Userjs-only version now supported hotkey Alt+Shift+L (for unblocking latest element) and can be started from opera buttons.
Item, "Block element" =Go to page, "javascript:navigator.ujs_adblock.block();",,,"Caption Close"
Item, "Block element (don't use nth-child)" =Go to page, "javascript:navigator.ujs_adblock.block(true);",,,"Caption Close"
-------------------1
Item, "Unblock element" =Go to page, "javascript:navigator.ujs_adblock.unblock();",,,"Mail Redirected"
Item, "Unblock latest element" =Go to page, "javascript:navigator.ujs_adblock.unblock(true);",,,"Mail Redirected"
-------------------2
Item, "Edit styles" =Go to page, "javascript:navigator.ujs_adblock.edit();",,,"Mail Draft"

CHROMAX 17. September 2009, 18:42

cool,

for the "wishlist".

Sometimes it is nearly impossible to get a div with an linked content, because if you click into the div it starts the content (sometimes flash). So you have to get the 1px wide css border.

Possible solution:
When you hover an object, there is a small button beneath the hovered object with an X button.
OR
to make the border bigger. Maybe 5px or so. But I didn´t tested that.

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