JS Adblock - Firefox only

Remove Pop-ups/In-video ads/Banner background : blogtruyen|vnsharing|hayhaytv|forum.bkav.com.vn|24h

  1. // ==UserScript==
  2. // @name JS Adblock - Firefox only
  3. // @description Remove Pop-ups/In-video ads/Banner background : blogtruyen|vnsharing|hayhaytv|forum.bkav.com.vn|24h
  4. // @version 1.724
  5. // @run-at document-start
  6. // @namespace ...
  7. // @include /^http:\/\/(blogtruyen\.com|vnsharing\.net|(www|jj)\.hayhaytv\.vn|vozforums\.com|forum\.bkav\.com\.vn)|24h\.com\.vn/
  8. // ==/UserScript==
  9.  
  10. var hostname = location.hostname;
  11. var fuck = 0;
  12. switch(hostname) {
  13. case "www.hayhaytv.vn":
  14. fuck = 1;
  15. checkForBadJavascripts ( [[ false, /vod\/info/, replaceJS ]] );
  16. break;
  17. case "blogtruyen.com":
  18. fuck = 3;
  19. checkForBadJavascripts ( [[ false, /popunder/, replaceJS ]] );
  20. break;
  21. case "vnsharing.net":
  22. fuck = 4;
  23. checkForBadJavascripts ( [[ false, /btpop/, replaceJS ]] );
  24. break;
  25. case "forum.bkav.com.vn":
  26. fuck = 5;
  27. checkForBadJavascripts ( [[ false, /jQuery\(document\)\.ready/, replaceJS ]] );
  28. break;
  29. default:
  30. break;
  31. }
  32.  
  33. function replaceJS (scriptNode) {
  34. var scriptSrc = scriptNode.textContent;
  35. switch(fuck) {
  36. case 1: scriptSrc = scriptSrc.replace ("vod", "shit"); break;
  37. case 3: scriptSrc = scriptSrc.replace ("pop", "shit"); break;
  38. case 4: scriptSrc = scriptSrc.replace ("pop", "shit"); break;
  39. case 5: scriptSrc = scriptSrc.replace ("doc", "shit"); break;
  40. default: break;
  41. }
  42. addJS_Node (scriptSrc)
  43. }
  44.  
  45. function checkForBadJavascripts (controlArray) {
  46. if ( ! controlArray.length) return null;
  47. checkForBadJavascripts = function (zEvent) {
  48. for (var J = controlArray.length - 1; J >= 0; --J) {
  49. var bSearchSrcAttr = controlArray[J][0];
  50. var identifyingRegex = controlArray[J][1];
  51. if (bSearchSrcAttr) {
  52. if (identifyingRegex.test (zEvent.target.src) ) {
  53. stopBadJavascript (J);
  54. return false;
  55. }
  56. }
  57. else {
  58. if (identifyingRegex.test (zEvent.target.textContent) ) {
  59. stopBadJavascript (J);
  60. return false;
  61. }
  62. }
  63. }
  64.  
  65. function stopBadJavascript (controlIndex) {
  66. zEvent.stopPropagation ();
  67. zEvent.preventDefault ();
  68.  
  69. var callbackFunction = controlArray[J][2];
  70. if (typeof callbackFunction == "function")
  71. callbackFunction (zEvent.target);
  72. zEvent.target.parentNode.removeChild (zEvent.target);
  73. controlArray.splice (J, 1);
  74. if ( ! controlArray.length) {
  75. window.removeEventListener (
  76. 'beforescriptexecute', checkForBadJavascripts, true
  77. );
  78. }
  79. }
  80. }
  81.  
  82. window.addEventListener ('beforescriptexecute', checkForBadJavascripts, true);
  83.  
  84. return checkForBadJavascripts;
  85. }
  86.  
  87. function addJS_Node (text, s_URL, funcToRun) {
  88. var D = document;
  89. var scriptNode = D.createElement ('script');
  90. scriptNode.type = "text/javascript";
  91. if (text) scriptNode.textContent = text;
  92. if (s_URL) scriptNode.src = s_URL;
  93. if (funcToRun) scriptNode.textContent = '(' + funcToRun.toString() + ')()';
  94.  
  95. var targ = D.getElementsByTagName ('head')[0] || D.body || D.documentElement;
  96. targ.appendChild (scriptNode);
  97. }
  98.  
  99. /* Kéo dài alt2 cho vOz */
  100. addGlobalStyle('@-moz-document domain(vozforums.com) {[style*=wrap] > STRONG {margin-right:100px}}');
  101.  
  102. /* Autohide thanh trên cùng hh */
  103. addGlobalStyle('@-moz-document domain(hayhaytv.vn) {.header:not(:hover){opacity:0;margin-top:-100px;transition:0.4s}}');
  104.  
  105. / * G b banner dng background 24h */
  106. addGlobalStyle('@-moz-document domain(24h.com.vn) { body {background:none !important}}');
  107.  
  108. function addGlobalStyle(css) {
  109. var head, style;
  110. head = document.getElementsByTagName('head')[0];
  111. if (!head) { return; }
  112. style = document.createElement('style');
  113. style.type = 'text/css';
  114. style.innerHTML = css;
  115. head.appendChild(style);
  116. }
  117.  
  118.  

QingJ © 2025

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