Noise Free YouTube ! — remove YouTube Mixes and Recommended videos.

Sabyasachi Patra
2 min readOct 31, 2018

A chrome extension to remove YouTube Mixes and Recommended videos.

Punjabi music is GOOD. They are very catchy. But I don’t like them. I am a Tagore fan, so much so that I have his name in my address. Accidentally last week I watched one Punjabi music video, after that the hell broke loose. I was getting bombarded with Punjabi music videos in my YouTube Mixes and Recommended videos. I wasn’t getting any solution out of the box. Being a fan of Javascript I knew I can solve this problem on my own. So, Here goes nothing… Oh and one more thing I use chrome as my daily driver

We will be making a Chrome Extension to remove YouTube Mixes and Recommended sections from showing up when ever we visit the website.

We will need two files and 50 lines of code to make this extension.

Step 1 : Irrespective of any operating system, create a folder NFYT . Create two files in the folder nfyt.js and manifest.json .

Step 2 : Put the following block of code in nfty.js and save

// this is the code which will be injected into youtube...

// Blacklisted channels, topics and titles
var blacklist = ['YouTube Mixes', 'Recommended'];

// Hides the blacklisted channels and titles on mouse scroll
(function() {
checkBlacklist();
window.onscroll = function (e) {
checkBlacklist();
}
})();

function checkBlacklist() {
var list = document.querySelectorAll("#title.ytd-shelf-renderer");
for (var item of list) {
if(blacklist.indexOf(item.innerHTML) > -1){
if(item.parentNode.parentNode.parentNode.parentNode.parentNode.tagName != 'ytd-shelf-renderer') {
item.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.style.display = 'none';
} else {
item.parentNode.parentNode.parentNode.parentNode.parentNode.style.display = 'none';
}
}
item.classList.remove("ytd-shelf-renderer");
}
}

Step 3 : Put the following block of code in manifest.json and save

{
"name": "NFYT",
"version": "0.0.1",
"manifest_version": 2,
"description": "Noise Free Youtube",
"browser_action": {
"default_title": "NFYT!"
},
"content_scripts": [
{
"run_at" :"document_end",
"matches": ["https://www.youtube.com/*"],
"js": ["nfty.js"]
}
]
}

Step 4 : Visit chrome://extensions/
Step 5 : Enable Developer mode at the top right corner

Step 6 : Click Load unpacked at the top left corner

Step 7 : Select the NFYT folder

..And that’s it. As of right now after this step you would not see the YouTube Mixes and Recommended videos.

But that’s not it you can also add channels and topic to blacklist. Add the channel or topic name in the blacklist array and run Steps 4 to 7 to blacklist them.

TL;DR version
Clone the NFYT repository from github and follow the steps there. Contributes are welcome.

This brings us to the end of the post. This post was the result of the frustration of unwanted videos on Youtube. Kudos to you if you made it this far.

Feel free to Comment or Share this post. Thanks for reading!

--

--