I'm using this script:
$(function() {
$(".video-list-item").filter(function() {
return $('span', this).hasClass('view-count');
}).hide();
});
Each video on the sidebar has parent <li>
item with .video-list-item
class, but the 'Recommended for you' ones has a child span
with class .view-count
.
And to inject it to the page I use Firefox addon Custom Style Script.
And this is how it looks in settings page:
But it doesn't work on YouTube, the Recommended videos still show and don't hide. I thought script don't work, but it does on jsfiddle.net: https://jsfiddle.net/rn2jzpfc/
The Firefox extension works, because I use it for other sites to e.g. customize CSS and it works fine.
Disabling watching history on YouTube settings does not solve the problem.
If you wonder why I want to hide this is because I never watched anything e.g. related to Kardashians so why I'm being forced this shit into my sidebar?
EDIT1: OK, I injected some CSS just to check if it works, and looks like all of the items on the sidebar has the .view-count class, so if script did work it would hide all of them. So I need a script that detects keywords 'Recommended' and hide based on that instead.
EDIT2: OK, I came up with this How to hide table rows containing certain keywords? but it's still not applying on YouTube page, but works on jsfiddle.net