Remove Clip, Thanks, and Download

Removes the "CLIP", "THANKS", and "DOWNLOAD" buttons from the Watch page

  1. // ==UserScript==
  2. // @name Remove Clip, Thanks, and Download
  3. // @namespace aubymori
  4. // @version 1.1
  5. // @description Removes the "CLIP", "THANKS", and "DOWNLOAD" buttons from the Watch page
  6. // @author You
  7. // @match www.youtube.com/*
  8. // @icon https://www.youtube.com/favicon.ico
  9. // @grant none
  10. // @license MIT
  11. // @run-at document-start
  12. // ==/UserScript==
  13.  
  14. const rctStyle = document.createElement("style");
  15. rctStyle.innerHTML = `
  16. ytd-download-button-renderer {
  17. display: none !important;
  18. }
  19. `;
  20. document.getElementsByTagName("head")[0].appendChild(rctStyle);
  21.  
  22. async function waitForElm(q) {
  23. while (document.querySelector(q) == null) {
  24. await new Promise(r => requestAnimationFrame(r));
  25. };
  26. return document.querySelector(q);
  27. };
  28.  
  29. document.addEventListener("yt-page-data-updated", () => {
  30. waitForElm("#top-level-buttons-computed.ytd-menu-renderer").then((btns) => {
  31. var abList = btns.querySelectorAll("ytd-button-renderer");
  32.  
  33. for(i = 0; i < abList.length; i++) {
  34. if (abList[i].data.icon.iconType == "MONEY_HEART" || abList[i].data.icon.iconType == "CONTENT_CUT") {
  35. abList[i].remove();
  36. }
  37. }
  38. });
  39. });