🏠 Home 

Simple YouTube Channel Subscriptions Filter-IN

You have like 200 channel subscriptions but only really follow a few? put them on the 'matchList' variable and other channels will not be visible on the quick list.


Installer dette script?
  1. // ==UserScript==
  2. // @name Simple YouTube Channel Subscriptions Filter-IN
  3. // @version 0.1 alpha
  4. // @description You have like 200 channel subscriptions but only really follow a few? put them on the 'matchList' variable and other channels will not be visible on the quick list.
  5. // @match http://www.youtube.com/*
  6. // @match http://youtube.com/*
  7. // @match https://www.youtube.com/*
  8. // @match https://youtube.com/*
  9. // @license GPLv3 - http://www.gnu.org/licenses/gpl-3.0.en.html
  10. // @copyright teken
  11. // @namespace https://greasyfork.org/users/17433
  12. // ==/UserScript==
  13. var funcFilter = function() {
  14. var aElementList = [];
  15. var hideAllChannelsFirst = document.getElementsByClassName("video-thumb yt-thumb yt-thumb-20");
  16. for (var iHide = 0; iHide < hideAllChannelsFirst.length; iHide++) {
  17. hideAllChannelsFirst[iHide].parentElement.parentElement.parentElement.parentElement.style.display = "none";
  18. }
  19. var bestChannels;
  20. var matchList = [ //it is CASE SENSITIVE, simply change and add new entries as shown below.
  21. "Channel Name 1",
  22. "chaNNel naME 2",
  23. ];
  24. for (var iMatch = 0; iMatch < matchList.length; iMatch++) {
  25. bestChannels = document.evaluate("//span[contains(text(),'"+matchList[iMatch]+"')]", document, null, XPathR###lt.UNORDERED_NODE_SNAPSHOT_TYPE, null);
  26. for (var iFillFinal = 0; iFillFinal < bestChannels.snapshotLength; iFillFinal++) {var temp1 = bestChannels.snapshotItem(iFillFinal);aElementList.push(temp1);}
  27. }
  28. //console.log("DEBUG2: "+aElementList.length);
  29. for (var iUnhideBest = 0; iUnhideBest < aElementList.length; iUnhideBest++) {
  30. var temp2 = aElementList[iUnhideBest];
  31. temp2.parentElement.parentElement.parentElement.parentElement.style.display = ""; //clear the "none" value
  32. //temp2.style.color = "#FFFF00";
  33. //temp2.style.backgroundColor = "#0000A0";
  34. }
  35. };
  36. document.addEventListener("DOMSubtreeModified", function() { funcFilter(); } , false);