tsdm no Popups

天使动漫论坛签到点击表情防弹窗处理

  1. // ==UserScript==
  2. // @name tsdm no Popups
  3. // @author Ted423
  4. // @description 天使动漫论坛签到点击表情防弹窗处理
  5. // @namespace https://github.com/ted423
  6. // @include https://www.tsdm.love/*
  7. // @include http://www.tsdm.love/*
  8. // @version 1.8
  9. // @grant none
  10. // ==/UserScript==
  11. var temp=document.getElementById("inner_stat");
  12. if(temp!==null){temp=temp.childNodes;
  13. for(i=0;i<temp.length;i++)
  14. {
  15. if(temp[i].href==="javascript:;")
  16. temp=temp[i];
  17. }
  18. temp.childNodes[0].textContent="签到";
  19. var tempOnclick=temp.onclick;
  20. }
  21. else temp =document.getElementsByTagName("font")[0];
  22. temp.textContent="签到";
  23. temp.onclick = function(){
  24. if(window.navigator.userAgent.indexOf("Chrome")===-1){
  25. var temp2;
  26. temp1=temp.attributes;
  27. for(i=0;i<temp1.length;i++)
  28. if(temp1[i].value.indexOf("showWindow")!=-1){
  29. console.log(i);
  30. console.log(temp1[i].value);
  31. temp2=temp1[i].value;
  32. break;
  33. }
  34. eval(temp2);
  35. }
  36. var callback = function(records){
  37. records.map(function(record){
  38. if((record.target.id==='fwin_content_dsu_paulsign')&&(record.target.nextElementSibling)){
  39. var script = document.createElement('script');
  40. script.type = 'text/javascript';
  41. fn="function openTsRecommend(sId){};";
  42. script.textContent = fn.toString();
  43.  
  44. var de = document.documentElement;
  45. de.appendChild(script);
  46. Icon_selected("ng");
  47. mo.disconnect();
  48. }
  49. });
  50. };
  51.  
  52. var mo = new MutationObserver(callback);
  53.  
  54. var option = {
  55. 'childList': true,
  56. 'subtree': true,
  57. 'characterData' : true
  58. };
  59. var element = document.getElementById("fwin_content_dsu_paulsign");
  60. mo.observe(document.body, option);
  61. tempOnclick();
  62. }