Custom ABP Filter - How to Select / Hide Parent Element

I want to know if there is a way to hide the parent of the identified element.

eg:

<div> <span id="abx">some garbage content</span> <div>other garbage containers not having any class or id</div> </div> 

The custom AdBlockPlus filter for choosing abx will be:

 ##span#abx 

But how to choose its parent? because we need to hide all the brothers and sisters of the identified element.

+7
css adblock
source share
2 answers

You cannot do this due to CSS 3 limitations.

After implementing relational pseudo-class :: has () from the Level 4 Selector, the following syntax will be available:

After implementation / p>

 example.com##div:has(> #abx) 

for this function.

+4
source share

It would be possible to use a relational pseudo-class: yes, but it is not currently supported.

(The object selector is removed from the specification: http://css4.rocks/selectors-level-4/subject-of-selector.php )

This feature has not been part of CSS before due to performance .

There is a polyfill in uBlock Origin .

+1
source share

All Articles