Blocking Specific User Comments
Blocking Specific User Comments
Hello, I'm new to Adblock Plus, and I'm not sure if this has already been mentioned, but is there anyway to block certain users' comments on YouTube? I don't want to block every single comment. Just the ones that annoy me. I tried using "Block Element" one of the comments, but it just really blocks every comment, even the 'good' ones. I even tried finding Element Hiding Helper, but apparently, it is not available for Google Chrome. Is there any way for me to block the specific YT user? Thanks!
Re: Blocking Specific User Comments
The only reliable way to do it, considering that the user's name or ID is not an attribute of the HTML element that the comment is in, or any of its parents, is to use either an experimental implementation of the :has() relational selector (which no browser natively supports), or experimental XPath.
Both of those things are under consideration for ABP, and both already exist in uBlock Origin.
A sketch of how :has() would work is something like youtube.com##div.comment-renderer:has(>div.comment-renderer-content>div.comment-renderer-header>a[data-ytid="CHANNEL_ID"]), where CHANNEL_ID can be found by right-clicking the user's comment and picking Inspect Element.
For XPath, you could craft a similar query for finding "a div with class comment-renderer that has an immediate child that is a div with class comment-renderer-content...", or (if you wish to allow false positives), you can figure out how to target the element based on its text content, which cannot be done in CSS; as with :has(), you need a specific filter (at least one domain left of the ## part), and the format after the ## part is :xpath(XPATH_QUERY).
A couple of decent sources for info. on crafting XPath queries are W3Schools (not affiliated with the W3C but much more understandable than the spec) and MSDN.
Both of those things are under consideration for ABP, and both already exist in uBlock Origin.
A sketch of how :has() would work is something like youtube.com##div.comment-renderer:has(>div.comment-renderer-content>div.comment-renderer-header>a[data-ytid="CHANNEL_ID"]), where CHANNEL_ID can be found by right-clicking the user's comment and picking Inspect Element.
For XPath, you could craft a similar query for finding "a div with class comment-renderer that has an immediate child that is a div with class comment-renderer-content...", or (if you wish to allow false positives), you can figure out how to target the element based on its text content, which cannot be done in CSS; as with :has(), you need a specific filter (at least one domain left of the ## part), and the format after the ## part is :xpath(XPATH_QUERY).
A couple of decent sources for info. on crafting XPath queries are W3Schools (not affiliated with the W3C but much more understandable than the spec) and MSDN.
There's a buzzin' in my brain I really can't explain; I think about it before they make me go to bed.