ftv

try to take over the world!

当前为 2017-10-25 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name ftv
  3. // @version 5.0.6
  4. // @namespace http://tampermonkey.net/
  5. // @description try to take over the world!
  6. // @author You
  7. // @match https://www.youtube.com/*
  8. // @require http://code.jquery.com/jquery-2.1.4.min.js
  9. // @require https://code.jquery.com/ui/1.12.1/jquery-ui.js
  10. // @grant none
  11. // ==/UserScript==
  12. $(document).ready(function(){
  13. var my= String($("yt-img-shadow#avatar").find("img").attr("src")).substr(22,6);
  14. add();
  15. $("#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='過濾名單' >");
  16. $("body").append("<div id='list' style='border:1px #426487 solid;font-size:small;display:none;position:absolute;right:0px;z-index:999;background:#fff;'></div>");
  17. $("#listbtn").click(function(){$("#list").toggle(200);});
  18. $("#listbtn").mouseleave(function(){ $(this).attr("src","https://gaming.youtube.com/s/gaming/emoji/72836fb0/emoji_u1f60e.svg");});
  19. $("#listbtn").mouseover(function(){ $(this).attr("src","https://gaming.youtube.com/s/gaming/emoji/72836fb0/emoji_u1f633.svg");});
  20. $("div#items").on("DOMNodeInserted",function(e){
  21. if(e.target.tagName == "SPAN" ){
  22. var a = e.target.parentNode.parentNode.firstChild.childNodes[0].src.substr(22,6);
  23. $("yt-live-chat-text-message-renderer").last().hide();
  24. var m = $("yt-live-chat-text-message-renderer").last().find("img#img");
  25. setTimeout(function(){
  26. if($("[id='"+a+"']").html() === undefined){$(this).remove();}
  27. m.attr("it",a).attr("new","o").attr("ix",m.parents("yt-live-chat-text-message-renderer").attr("id").substr(30,10)).css({"cursor":"pointer"});
  28. var mp = $('.mp').map(function() {
  29. return this.id;
  30. }).get().join('');
  31. if(mp.match(m.attr("it")) != m.attr("it") || m.attr("it") == my){
  32. $("div#items").css("transform","translatey(-2px)");
  33. $("div#items").css("transform","translatey(-2px)");
  34. $("[it='"+a+"']").parents("yt-live-chat-text-message-renderer").slideDown(200);
  35. }else{
  36. $("[id='"+a+"']").animate({opacity:'0'}).animate({opacity:'1'});
  37. console.log($("[id='"+a+"']").html()+":"+m.parents("yt-live-chat-text-message-renderer").find("span#message").text());
  38. }
  39. m.last().one("click",function(){
  40. // $("#list").append(m.attr("it")+"【");
  41. $("#list").append("<div style='background:#666666;color:#fff;margin:1px;padding:1px;cursor:pointer;' class='mp' id='"+m.attr("it")+"'>"+m.parents("yt-live-chat-text-message-renderer").find("#author-name").html().substr(0,10)+"</div>");
  42. $("[it='"+m.attr("it")+"']").parents("yt-live-chat-text-message-renderer").hide();
  43. $(".mp").click(function(){$(this).remove();});
  44. });
  45. },600);
  46. }
  47. });
  48. function add(){
  49. $("yt-live-chat-text-message-renderer").find("img#img").each(function(){
  50. if(!$(this).attr("new")){
  51. $(this).css("cursor","pointer").attr("new","o").attr("it",$(this).attr("src").substr(22,6));
  52. $(this).on("click",function(){
  53. $("#list").append("<div style='background:#666666;color:#fff;margin:1px;padding:1px;cursor:pointer;' class='mp' id='"+$(this).attr("it")+"'>"+$(this).parents("yt-live-chat-text-message-renderer").find("#author-name").html().substr(0,10)+"</div>");
  54. $("[it='"+$(this).attr("it")+"']").parents("yt-live-chat-text-message-renderer").hide();
  55. $(".mp").click(function(){$(this).remove();});
  56. });
  57. }
  58. if($("#list").text().match(String($(this).attr("it")))){
  59. $(this).parents("yt-live-chat-text-message-renderer").hide();
  60. }
  61. });
  62. }
  63. });

QingJ © 2025

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