YouTube "Not Interested" Button Script

Step 1: Install Tampermonkey

Download and install Tampermonkey from www.Tampermonkey.net.

Step 2: Create a New Script

Click on Create New Script in the Tampermonkey dashboard.

Step 3: Paste the Following Code

// ==UserScript== // @name YouTube Show "Not Interested" Option on Homepage // @namespace http://tampermonkey.net/ // @version 1.3 // @description Adds a "Not Interested" button below the video title on the YouTube homepage. // @author YourName // @match https://www.youtube.com/ // @grant none // ==/UserScript== (function () { 'use strict'; // Function to add the "Not Interested" button next to each video function addNotInterestedButtons() { const videoCards = document.querySelectorAll('ytd-rich-item-renderer'); videoCards.forEach((card) => { if (card.querySelector('.custom-not-interested-button')) return; const notInterestedButton = document.createElement('button'); notInterestedButton.textContent = 'Not Interested'; notInterestedButton.className = 'custom-not-interested-button'; notInterestedButton.style.marginTop = '5px'; notInterestedButton.style.padding = '5px 10px'; notInterestedButton.style.backgroundColor = '#FFCC00'; notInterestedButton.style.color = '#000'; notInterestedButton.style.border = 'none'; notInterestedButton.style.cursor = 'pointer'; notInterestedButton.style.borderRadius = '3px'; notInterestedButton.style.display = 'block'; notInterestedButton.onclick = () => { const ellipsisButton = card.querySelector('#button[aria-label*="Action menu"]'); if (ellipsisButton) { ellipsisButton.click(); setTimeout(() => { const notInterestedOption = document.evaluate( "//yt-formatted-string[contains(text(), 'Not interested')]", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null ).singleNodeValue; if (notInterestedOption) notInterestedOption.click(); }, 500); } }; const titleContainer = card.querySelector('#meta'); if (titleContainer) titleContainer.appendChild(notInterestedButton); }); } const observer = new MutationObserver(addNotInterestedButtons); observer.observe(document.body, { childList: true, subtree: true }); addNotInterestedButtons(); })();

Step 4: Try It Out!

Visit YouTube's homepage and see the "Not Interested" button in action!

[ Edward Collier's NewWorldAddress.com City: Orlando Tue Nov 26 2024 18:57:18 GMT-0500 (Eastern Standard Time) ]