HacPai防黄图哥聊天室插件

https://hacpai.com/cr 日防夜防,黄图哥难防

  1. // ==UserScript==
  2. // @name HacPai防黄图哥聊天室插件
  3. // @namespace https://github.com/AdlerED
  4. // @version 1.0.3
  5. var version = "1.0.3";
  6. // @description https://hacpai.com/cr 日防夜防,黄图哥难防
  7. // @author Adler
  8. // @connect hacpai.com/cr
  9. // @include https://hacpai.com/cr*
  10. // @require https://code.jquery.com/jquery-1.11.0.min.js
  11. // @note 20-04-30 1.0.3 修复插件功能
  12. // @note 19-07-04 1.0.1 只屏蔽黄图哥的图片,不屏蔽文字了
  13. // @note 19-07-04 1.0.0 初版发布,黄图哥受死吧
  14. // ==/UserScript==
  15.  
  16. (function() {
  17. var blackList = [ "@2501224066", "@Sunnnner" ];
  18. setInterval(function() {
  19. $(".chats__item").each(function(index,domEle) {
  20. var username = $(domEle).find(".chatAt").text();
  21. console.log(username);
  22. if ($.inArray(username, blackList) != -1) {
  23. var htgHtml = $(domEle).find(".vditor-reset").html();
  24. if (htgHtml.indexOf("img") != -1) {
  25. $(domEle).find(".vditor-reset").html("<h3>已屏蔽</h3>");
  26. }
  27. }
  28. });
  29. }, 1000);
  30. })();