Adblock. Add css class or remove attribute from element

Viewed 21045

Is it possible to add css rule to an element at some page by adblock? Something like this

#myElement {
    color: white !important;
}

I tried to find a script that updates style of this element on page load but it seems that it is not a best way.

4 Answers

The other answers weren't working for me but there is a way to change an element's style:

example.com##h1:style(background-color: blue !important)

Make sure not to use curly brackets.

There is also some documentation on GitHub.

EDIT: As BeeLabeille mentioned this advice seems specific to uBlock.

For AdBlock Plus, you can try this:

##.ytp-pause-overlay, .ytp-scroll-min
##.html5-endscreen, .ytp-player-content, .videowall-endscreen, .ytp-endscreen-paginate, .ytp-show-tiles
##.ytp-endscreen-content

This should disable the display of ads during the pause, and recommended videos, at the end of the video.

PS: Ah.. this is not the subject of the question.. this removes the class from the div element. Well, maybe someone will come in handy, to delete unnecessary blocks in the Youtube player.

Related