🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

Youtube Hide Watched / Viewed Videos

Hides viewed videos from your subscriptions.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

// ==UserScript==
// @name           Youtube Hide Watched / Viewed Videos
// @description    Hides viewed videos from your subscriptions.
// @include        https://www.youtube.com/feed/subscriptions
// @license        MIT
// @version        0.5
// @date           26-09-2016
// @require        http://code.jquery.com/jquery-latest.min.js
// @namespace https://greasyfork.org/users/59385
// ==/UserScript==


$(function () {
  //Add mutation observer, checks for changes in DOM
  if (MutationObserver) {
	  var myObserver  = new MutationObserver(hideWatched);
	}
	else {
		var myObserver = new WebKitMutationObserver(hideWatched);
	}
  myObserver.observe(document, { childList : true, subtree : true });
	hideWatched();

	// Add checkbox
	var checker = '<li>\n'+
	              '\t<label id="checker-container">\n'+
				  '\t\t<input type="checkbox" id="hide-videos" checked="" />'+
				  '\t\tHide watched videos'+
				  '\t</label>\n'+
				  '</li>';
	$("#appbar-nav .appbar-nav-menu").prepend(checker);
	$("#checker-container").css({
	                              'color': "#666",
								  "vertical-align" : "middle",
								  "text-align" : "center"
								});
	//checkbox event
	$("#hide-videos").change(function() {
		if ( $(this).is(":not(:checked)") ) {
			showWatched();
		}

		else {
			hideWatched();
		};

	});

	//BONUS: always enable load more button.
	$("button.load-more-button").removeProp("disabled");

	hideWatched();


});


function hideWatched () {
	if ( $("#hide-videos").is(":checked") ) {
			$("span.resume-playback-progress-bar").each(function() {
	      $(this).closest(".yt-shelf-grid-item").hide("1000");
	    });
	}
};

function showWatched() {
  $("span.resume-playback-progress-bar").each(function() {
    $(this).closest(".yt-shelf-grid-item").show("200");
	});
}