Please help with syntax

Everything about using Adblock Plus on Google Chrome
Post Reply
AdblockPlus150702
Posts: 16
Joined: Thu Jul 02, 2015 4:48 am

Please help with syntax

Post by AdblockPlus150702 »

Please help with syntax

Idea is to block those <li> with <a href> containing ad_* but not the others

<li class="abcd efgh"><a href="/ijkl/old_123">OLD_123</a></li>
<li class="abcd efgh"><a href="/ijkl/ad_123">AD_123</a></li>
<li class="abcd efgh"><a href="/ijkl/new_123">NEW_123</a></li>
<li class="abcd efgh"><a href="/ijkl/old_456">OLD_456</a></li>
<li class="abcd efgh"><a href="/ijkl/ad_456">AD_456</a></li>
<li class="abcd efgh"><a href="/ijkl/new_456">NEW_456</a></li>
<li class="abcd efgh"><a href="/ijkl/old_789">OLD_789</a></li>
<li class="abcd efgh"><a href="/ijkl/ad_789">AD_789</a></li>
<li class="abcd efgh"><a href="/ijkl/new_789">NEW_789</a></li>

Thanks in advance
lewisje
Posts: 2743
Joined: Mon Jun 14, 2010 12:07 pm

Re: Please help with syntax

Post by lewisje »

To hide an element based on its text content, you need XPath, which is being considered for ABP and currently supported by uBlock Origin: forum/viewtopic.php?f=4&t=21209
There's a buzzin' in my brain I really can't explain; I think about it before they make me go to bed.
AdblockPlus150702
Posts: 16
Joined: Thu Jul 02, 2015 4:48 am

Re: Please help with syntax

Post by AdblockPlus150702 »

lewisje wrote:To hide an element based on its text content, you need XPath, which is being considered for ABP and currently supported by uBlock Origin: viewtopic.php?f=4&t=21209
@lewisje
Thanks for your advice, leading me to several pages which those having the same question and also not going for uBlock Origin may find useful.

#2360 Add ability to hide elements by their child elements
https://issues.adblockplus.org/ticket/2360
status: split into #3142 and #3143

#3142 Add XPath capabilities to element hiding filters
https://issues.adblockplus.org/ticket/3142
status: pending

#3143 Add polyfill for ':has()' CSS4 pseudo-selector to element hiding filters
https://issues.adblockplus.org/ticket/3143
status: implemented
Post Reply