I want to know if there is a way to hide parent element of an identified element.
for example:
<div>
<span id="abx">some garbage content</span>
<div>other garbage containers not having any class or id</div>
</div>
The custom filter of AdBlockPlus to select abx
will be:
##span#abx
But how to select its parent element? because we need to hide all siblings of identified element.
Element hiding filters are designed to indicate which element in the page are to be hidden. Snippet filters are used to run snippets of code in the page to defeat more complex advertising display.
Click the AdBlock icon on your browser's toolbar, then the gear symbol on the dropdown menu. On the options menu, select the Customize tab. Click Edit to open the custom filters field. Paste the filter exactly as given in the field (or delete any unwanted filters) and click Save.
You can use an AdblockPlus CSS selector.
#?#div:-abp-has(span###abx)
https://adblockplus.org/development-builds/new-syntax-for-advanced-element-hiding-rules
You can't do that, because of limitations of CSS 3.
It will be possible after implementation of the relational pseudo-class: :has() from Selectors Level 4, with following syntax:
example.com##div:has(> #abx)
Current support for this feature.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With