Adblock. Add css class or remove attribute from element

It's possible to do it on uBlock Origin and Adguard (as far as I know). Each has its own syntax for the styling rules, but uBlock is capable understanding both.


Here is an example of a CSS rule that changes Twitter background:

twitter.com#$#body.logged-in{ background-color: #8c8787 !important; }

The styling filters should be constructed like this:

<domain> + #$# + <selector> + { <style> }

Just avoid puting a space between the selector and the opening brace. Cause it can give you some trouble. Reference:

https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#style https://adguard.com/en/filterrules.html#cosmetic-css-rules


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.

Tags:

Adblock