您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
try to take over the world!
当前为
// ==UserScript== // @name ftv // @version 5.0.2 // @namespace http://tampermonkey.net/ // @description try to take over the world! // @author You // @match https://www.youtube.com/live_chat?continuation=0ofMyAMmGiBDZzhLRFFvTFdIaEtTMjVFVEZsYWVqUWdBUSUzRCUzRDABaAE%253D // @require http://code.jquery.com/jquery-2.1.4.min.js // @require https://code.jquery.com/ui/1.12.1/jquery-ui.js // @grant none // ==/UserScript== $(document).ready(function(){ var my= $("yt-img-shadow#avatar").find("img").attr("src").substr(22,6); add(); $("#title").append("<img id='listbtn' style='cursor:pointer;width:24px;height:24px;' src='https://gaming.youtube.com/s/gaming/emoji/72836fb0/emoji_u1f60e.svg' alt='過濾名單' >"); $("body").append("<div id='list' style='border:1px #000 solid;font-size:small;display:block;position:absolute;right:0px;z-index:999;background:#fff;'></div>"); $("#listbtn").click(function(){$("#list").toggle(200);}); $("#listbtn").mouseleave(function(){ $(this).attr("src","https://gaming.youtube.com/s/gaming/emoji/72836fb0/emoji_u1f60e.svg");}); $("#listbtn").mouseover(function(){ $(this).attr("src","https://gaming.youtube.com/s/gaming/emoji/72836fb0/emoji_u1f633.svg");}); //document.getElementById("items").addEventListener("DOMNodeInserted",function(e){ $("div#items").on("DOMNodeInserted",function(e){ // console.log(e.target.tagName); if(e.target.tagName == "SPAN" ){ $("yt-live-chat-text-message-renderer").last().hide(); var m = $("yt-live-chat-text-message-renderer").last().find("img"); m.on("click",function(){ $("#list").append(m.attr("it")+"【"); $("#list").append(m.parents("yt-live-chat-text-message-renderer").find("#author-name").html().substr(0,10)+"】<br>"); $("[it='"+m.attr("it")+"']").parents("yt-live-chat-text-message-renderer").hide(); }); setTimeout(function(){ var mh = m.parents("yt-live-chat-text-message-renderer").height(); var a = e.target.parentNode.parentNode.firstChild.childNodes[0].src.substr(22,6); m.attr("it",a).attr("new","o").css({"cursor":"pointer"}); //var mmh = $("#item-offset").height(); //console.log(m.parents("yt-live-chat-text-message-renderer").height()); // m.parents("yt-live-chat-text-message-renderer").hide(); if( $("#list").text().match(m.attr("it")) != m.attr("it") || m.attr("it") == my){ if($("yt-live-chat-text-message-renderer").last().find("span#author-name").html() == "中央山脈"){ $("yt-live-chat-text-message-renderer").last().find("span#author-name").html("檢小孩賤賣"); } $("div#items").css("transform","translatey(-3px)"); $("[it='"+a+"']").parents("yt-live-chat-text-message-renderer").show(200); } // var size = $("yt-live-chat-text-message-renderer").size(); //if(size > 75){ $("yt-live-chat-text-message-renderer:lt(5)").remove(); } //console.log($("yt-live-chat-text-message-renderer").size()); console.log(a.length); // console.log($("#items").scrollTop()); //$("#item-scroller").scrollTop($("#item-scroller").scrollTop()+mh); // $("div#items").css("transform","translatey("+mh+"px)"); //$("#item-offset").css({"height":mmh+mh+"px"}); },200); } }); // setInterval(function(){ // $("yt-live-chat-text-message-renderer").find("img").each(function(){ // if( $("#list").text().match($(this).attr("it")) != $(this).attr("it") ){$("div#items").css({"transform":"translateX(1px)"}); $("[it='"+$(this).attr("it")+"']").parents("yt-live-chat-text-message-renderer").show(); } //}); //},300); function add(){ $("yt-live-chat-text-message-renderer").find("img").each(function(){ if(!$(this).attr("new")){ $(this).css("cursor","pointer").attr("new","o").attr("it",$(this).attr("src").substr(22,6)); $(this).on("click",function(){ $("#list").append($(this).attr("it")+"【"); $("#list").append($(this).parents("yt-live-chat-text-message-renderer").find("#author-name").html().substr(0,10)+"】<br>"); $("[it='"+$(this).attr("it")+"']").parents("yt-live-chat-text-message-renderer").hide(); }); } if($("#list").text().match(String($(this).attr("it")))){ $(this).parents("yt-live-chat-text-message-renderer").hide(); } }); } });