How to select text node in a div

Everything about using Adblock Plus on Mozilla Firefox, Thunderbird and SeaMonkey

How to select text node in a div

Postby johnman » Sun Aug 02, 2020 9:33 am

I have this :
Code: Select all
<div class="foo">
    <h3>Title</h3>
    Some text I want to block it
    <div class="subfoo">Some other text I dont want to block it</div>
</div>

Is it possible to select only text node ?
johnman
 
Posts: 3
Joined: Sun Aug 02, 2020 9:21 am

Re: How to select text node in a div

Postby greiner » Mon Aug 03, 2020 1:13 pm

Adblockers use CSS to hide elements on the page and, as far as I'm aware of, you cannot select or apply styles to text nodes.
User avatar
greiner
ABP Developer
 
Posts: 780
Joined: Mon Sep 03, 2012 5:29 pm
Location: Cologne, Germany

Re: How to select text node in a div

Postby johnman » Wed Aug 05, 2020 6:08 am

Hello,
Is there any other way to do this, or i just cant block it anyway?
There is something really annoying and i want to block it.
pls help
johnman
 
Posts: 3
Joined: Sun Aug 02, 2020 9:21 am

Re: How to select text node in a div

Postby johnman » Tue Aug 11, 2020 5:32 am

Adblock used to be very useful, But this time it is just useless. Even nobody answer me in this forum. Why dont you use xpath /instead of this? It can do this shit.
johnman
 
Posts: 3
Joined: Sun Aug 02, 2020 9:21 am

Re: How to select text node in a div

Postby greiner » Tue Aug 11, 2020 4:14 pm

Similar to CSS, XPath can select elements on the page. For hiding those, however, you still need CSS styles, which cannot be applied to text nodes.

That being said, there's a proposal for adding a snippet that would allow you to create custom filters to either remove such text nodes from the page or to wrap them inside HTML elements and hide those ones instead (see core#240).
User avatar
greiner
ABP Developer
 
Posts: 780
Joined: Mon Sep 03, 2012 5:29 pm
Location: Cologne, Germany


Return to Adblock Plus for Firefox support

Who is online

Users browsing this forum: Banning, Google [Bot] and 12 guests