YouTube Hide recommended videos

Hides the recommended videos on your stream (new design)

目前為 2014-08-15 提交的版本,檢視 最新版本

// ==UserScript==
// @name       YouTube Hide recommended videos
// @namespace  ef0mwUGrgwzkNkfCE3ecJ5K1URMi6r
// @version    20140815a
// @description  Hides the recommended videos on your stream (new design)
// @include      *://youtube.com/*
// @include      *://*.youtube.com/*
// @copyright  2014 Mr. Anonymous
// ==/UserScript==

!(function() {
  window.setTimeout(function check() {
    if (document.getElementsByClassName('shelf-title-annotation')) {
      main();
    }
    window.setTimeout(check, 250);
  }, 250);

  function main() {
    var lang = document.querySelector('[data-picker-key="language"]').outerText;  
    
    switch (lang) {
      case " Язык: Русский  ":
	var AggroText = "Рекомендованный популярный канал"
        break;
      case " Language: English  ":
	var AggroText = "Popular channel you might like"
        break;
      case " Language: English (UK)  ":
	var AggroText = "Popular channel you might like"
        break;
/* 
If you need to add your language, add this block to "case" statement 
and copy-paste text of "Popular channel you might like" span to it:

      case TEXT_AT_BUTTON_IN_FOOTER_OF_MAIN_PAGE:
	var AggroText = LOCALIZED_STRING_OF_"Popular channel you might like"
        break;
*/
 

    }
    
    alert(lang);

    var a = document.getElementsByClassName('shelf-title-annotation');
    for(var i = 0, len = a.length; i < len; i++) {
      if (a[i].innerText == AggroText) {
        a[i].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.style.display = 'none';
      }
    }
  }
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址