kukuku_hide_zz

k岛屏蔽某id的串

  1. // ==UserScript==
  2. // @name kukuku_hide_zz
  3. // @description k岛屏蔽某id的串
  4. // @namespace https://greasyfork.org/zh-CN/scripts/27596
  5. // @include http://www.kukuku.cc/*
  6. // @include http://www.kukuku.cc/t/*
  7. // @version 1ku
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. var mdzz = ["cfBBq9FJ3a","ID_2"]; //黑名单
  12.  
  13. var topics = document.getElementsByClassName("h-threads-item");
  14. var replies = document.getElementsByClassName("h-threads-item-reply");
  15.  
  16. for (i = 0; i < topics.length; i++) {
  17. var topic = topics[i];
  18. var title1 = topic.getElementsByClassName("h-threads-info-uid")[0].innerHTML;
  19. for (j = 0; j < mdzz.length; j++) {
  20. var md = mdzz[j];
  21. if (title1.search(md) != -1) {
  22. topic.childNodes[1].style.color="#B2B2B2"; //淦他娘灰爆
  23. //第一个node[1]是item-main
  24. var zzMother = topic.childNodes[1].getElementsByClassName("h-threads-img-box");
  25. if (zzMother.length !== 0){
  26. zzMother[0].parentNode.removeChild(zzMother[0]);
  27. }
  28. //topic.parentNode.removeChild(topic);
  29. }
  30. }
  31. }
  32. for (m = 0; m < replies.length; m++) {
  33. var reply = replies[m];
  34. var title2 = reply.getElementsByClassName("h-threads-info-uid")[0].innerHTML;
  35. for (n = 0; n < mdzz.length; n++) {
  36. var zz = mdzz[n];
  37. if (title2.search(zz) != -1) {
  38. reply.style.color="#B2B2B2";
  39. //第一个node[3]是item-reply-main
  40. var zzMother2 = reply.childNodes[3].getElementsByTagName("img");
  41. if (zzMother2.length !== 0){
  42. zzMother2[0].parentNode.removeChild(zzMother2[0]);
  43. }
  44. //reply.parentNode.removeChild(reply);
  45. }
  46. }
  47. }