CSS selector not working

Posting here is no longer possible, please use the forum of a filter list project, such as EasyList
Locked
tonio09
Posts: 5
Joined: Tue Oct 15, 2013 3:10 am

CSS selector not working

Post by tonio09 »

Let's say I want to block a Youtube channel from appearing in the suggestions list.

For example, on this page I don't want any videos to appear by RayWilliamJohnson http://www.youtube.com/watch?v=pPaxJmjY ... 04892E2A1F

I've added this rule to the custom filter, why doesn't it work?

Code: Select all

www.youtube.com##LI[data-video-username="RayWilliamJohnson"]
Relevant html source:

Code: Select all

 <li class="video-list-item yt-uix-scroller-scroll-unit " data-video-clip-start="None" data-video-clip-end="None" data-video-id="ec7NVC5Mgwo" data-index="4" data-video-username="RayWilliamJohnson" data-video-title="Dat Face Tho"><a class="yt-uix-contextlink spf-link" href="/watch?v=ec7NVC5Mgwo&list=SP6A40AB04892E2A1F" title="Dat Face Tho" role="button"><span class="stat count">4</span><span class="ux-thumb-wrap">    <span class="video-thumb  yt-thumb yt-thumb-64"
      >
      <span class="yt-thumb-default">
        <span class="yt-thumb-clip">
          <span class="yt-thumb-clip-inner">
            <img data-group-key="watch-playlist-thumbs" alt="" data-thumb="//i1.ytimg.com/vi/ec7NVC5Mgwo/default.jpg" src="http://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif" data-thumb-manual="1" width="64" >
            <span class="vertical-align"></span>
          </span>
        </span>
      </span>
    </span>
</span><span dir="ltr" class="title">Dat Face Tho</span>  <span class="stat attribution">
by RayWilliamJohnson
  </span>
</a></li>
User avatar
mapx
Posts: 21940
Joined: Thu Jan 06, 2011 2:01 pm

Re: CSS selector not working

Post by mapx »

with your custom filter you'll have an empty list on the right, what else do you want obtain ?
tonio09
Posts: 5
Joined: Tue Oct 15, 2013 3:10 am

Re: CSS selector not working

Post by tonio09 »

mapx wrote:with your custom filter you'll have an empty list on the right, what else do you want obtain ?
I should have an empty list but in fact the filter does nothing.
User avatar
mapx
Posts: 21940
Joined: Thu Jan 06, 2011 2:01 pm

Re: CSS selector not working

Post by mapx »

in fact I said you'll obtain an empty list because I saw it :D
so, remove all other custom filters and try gain
tonio09
Posts: 5
Joined: Tue Oct 15, 2013 3:10 am

Re: CSS selector not working

Post by tonio09 »

Strictly speaking, only the RayWilliamJohnson videos should be removed on the right. I disabled all extensions on Chrome except for ABP. I also removed all subscriptions except for the one custom filter above. Then I restarted Chrome. When I click on the link above, I see RayWilliamJohnson videos on the right side in the related videos section.
User avatar
mapx
Posts: 21940
Joined: Thu Jan 06, 2011 2:01 pm

Re: CSS selector not working

Post by mapx »

oh no, your filter only removes the entries from the list on the right (top right) not the related
User avatar
mapx
Posts: 21940
Joined: Thu Jan 06, 2011 2:01 pm

Re: CSS selector not working

Post by mapx »

you can not block / hide those related videos (specifically only those of RayWilliamJohnson; RayWilliamJohnson in that case isnt the name of an ID, CLASS etc CSS element, it's only a description name)
tonio09
Posts: 5
Joined: Tue Oct 15, 2013 3:10 am

Re: CSS selector not working

Post by tonio09 »

Image
you can not block / hide those related videos (specifically only those of RayWilliamJohnson; RayWilliamJohnson in that case isnt the name of an ID, CLASS etc CSS element, it's only a description name)
The CSS selector rule

Code: Select all

LI[data-video-username="RayWilliamJohnson"]
should match the HTML code

Code: Select all

<li data-video-username="RayWilliamJohnson"></li>
User avatar
mapx
Posts: 21940
Joined: Thu Jan 06, 2011 2:01 pm

Re: CSS selector not working

Post by mapx »

there are 176

Code: Select all

li data-video-username=
elements

exactly the number of videos in the playlist ; so, it isnt about "suggestions" section
lewisje
Posts: 2743
Joined: Mon Jun 14, 2010 12:07 pm

Re: CSS selector not working

Post by lewisje »

If only the CSS4 subject specifier were supported in Firefox or Chrome, this would work:

Code: Select all

youtube.com##li! [data-ytid="UCGt7X90Au6BV8rf49BiM6Dg"]
(yes the space is required, it means "an li element that has a descendant with data-ytid equal to UCGt7X90Au6BV8rf49BiM6Dg")

As it is, the most you can do is hide the clickable links to that username, with this filter:

Code: Select all

youtube.com##li [data-ytid="UCGt7X90Au6BV8rf49BiM6Dg"]
(it means "an element with data-ytid equal to UCGt7X90Au6BV8rf49BiM6Dg that is a descendant of an li element")
Last edited by lewisje on Sat Jun 14, 2014 7:07 am, edited 1 time in total.
There's a buzzin' in my brain I really can't explain; I think about it before they make me go to bed.
User avatar
Gingerbread Man
Posts: 1339
Joined: Fri Aug 12, 2011 5:28 am

Re: CSS selector not working

Post by Gingerbread Man »

Split off previous post to forum/viewtopic.php?f=11&t=21209
lewisje
Posts: 2743
Joined: Mon Jun 14, 2010 12:07 pm

Re: CSS selector not working

Post by lewisje »

In the latest Editor's Draft the subject specifier was scrapped in favor of the "relational pseudo-class" :has(); it would work like this:

Code: Select all

youtube.com##li:has([data-ytid="UCGt7X90Au6BV8rf49BiM6Dg"])
I think the reason the first form (prepended "$") was scrapped was its similarity to constructs in jQuery and Prototype; the reason the last form (appended "!") was scrapped was its similarity to the prefix "logical NOT" in many programming languages, including those with C-like syntax.
There's a buzzin' in my brain I really can't explain; I think about it before they make me go to bed.
Locked