Greasy Fork is available in English.

Annoying Ad blocker

Prevents annoying ads from displaying

  1. // ==UserScript==
  2. // @name Annoying Ad blocker
  3. // @description Prevents annoying ads from displaying
  4. // @version 2017.08.54
  5. // @match *://*.amazon.com/*
  6. // @match *://*.bing.com/*
  7. // @match *://*.alltrails.com/*
  8. // @match *://*.ebay.com/*
  9. // @match *://*.thepiratebay.org/*
  10. // @match *://*.youtube.com/*
  11. // @match *://*.stackoverflow.com/*
  12. // @match *://*.finance.yahoo.com/*
  13. // @match *://*.dndbeyond.com/*
  14. // @namespace https://openuserjs.org/users/nonedude
  15. // @require http://code.jquery.com/jquery-1.11.1.min.js
  16. // @license MIT
  17. // ==/UserScript==
  18.  
  19. String.prototype.contains = function (it) { return this.indexOf(it) !== -1; };
  20.  
  21. var ssss = location.href;
  22.  
  23.  
  24. function dndbeyond()
  25. {
  26. $(".header-wrapper").remove();
  27. $("#site-main").css("background-color", "black");
  28. $("html").css("background-color", "black");
  29. $("[id^=cookie-consent-banner]").remove();
  30. $("footer").remove();
  31. }
  32.  
  33. function thepiratebay()
  34. {
  35. $("iframe").remove();
  36. }
  37. function amazon()
  38. {
  39. window.pdagSparkleClientContext = {};
  40. $("#pdagDesktopSparkleHeadlineContainer").remove();
  41. $("#sponsoredLinksCsaIframe").remove();
  42. $("#reports-ads-abuse").remove();
  43. $("#sponsoredLinksCSA").remove();
  44. $("#amsSparkleAdWrapper").remove();
  45. $("#pdagEncapsulated").remove();
  46. $(".slot__ad").remove();
  47. $("#adblk_yes").remove();
  48. $("#adblk_no").remove();
  49. $("#adblk_unk").remove();
  50.  
  51. $("#sponsoredLinksCsaIframe").html("");
  52. $("#reports-ads-abuse").html("");
  53. $("#sponsoredLinksCSA").html("");
  54. $("#amsSparkleAdWrapper").html("");
  55.  
  56. $(".s-sponsored-list-header").each(function (index, value)
  57. {
  58. $(this).parent().parent().remove();
  59. });
  60.  
  61. $(".s-sponsored-info-icon").each(function (index, value)
  62. {
  63. $(this).parent().parent().parent().parent().remove();
  64. });
  65.  
  66. console.log(new Date().getTime());
  67. }
  68.  
  69. function bing()
  70. {
  71. $(".b_ad").remove();
  72. }
  73.  
  74. function ebay()
  75. {
  76. $("[id^='wrapperDiv_rtm']").remove();
  77. $("[id^='scandal']").remove();
  78. $("[id^='rtm-mb']").remove();
  79. $(".mfe-cards").html("");
  80. $("[id^='wrapperDiv_rtm']").html("");
  81. $(".promoted-lv").parent().remove();
  82. $(".merch-module").remove();
  83. $(".s-item__title-tag").each(function (index, value)
  84. {
  85. $(this).parent().parent().parent().parent().parent().parent().remove();
  86. });
  87. }
  88. function youtube()
  89. {
  90. //$(".ytd-secondary-search-container-renderer").remove();
  91. //$("ytd-secondary-search-container-renderer").remove();
  92. //$("#main").remove();
  93.  
  94. $("yt-mealbar-promo-renderer").remove();
  95. }
  96. function stackoverflow()
  97. {
  98. $(".js-consent-banner").remove();
  99. }
  100.  
  101. function yahoo()
  102. {
  103. $(".YDC-Overlay").remove();
  104. $("#dropdown-menu").remove();
  105. }
  106.  
  107. function alltrails()
  108. {
  109. console.log(new Date().getTime());
  110. $("#modalPortal").remove();
  111. }
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118. if (ssss.contains("ebay"))
  119. {
  120. ebay();
  121. window.setInterval(function ()
  122. {
  123. ebay();
  124. }, 1000);
  125.  
  126. }
  127. if (ssss.contains("bing"))
  128. {
  129. bing();
  130. window.setInterval(function ()
  131. {
  132. bing();
  133. }, 1000);
  134. }
  135.  
  136. if (ssss.contains("amazon"))
  137. {
  138. amazon();
  139. window.setInterval(function ()
  140. {
  141. amazon();
  142. }, 1000);
  143. }
  144.  
  145. if (ssss.contains("thepiratebay"))
  146. {
  147. piratebay();
  148. window.setInterval(function ()
  149. {
  150. piratebay();
  151. }, 1000);
  152. }
  153. if (ssss.contains("youtube"))
  154. {
  155. youtube();
  156. window.setInterval(function ()
  157. {
  158. youtube();
  159. }, 1000);
  160. }
  161. if (ssss.contains("stackoverflow"))
  162. {
  163. stackoverflow();
  164. window.setInterval(function ()
  165. {
  166. stackoverflow();
  167. }, 1000);
  168. }
  169. if (ssss.contains("yahoo"))
  170. {
  171. yahoo();
  172. window.setInterval(function ()
  173. {
  174. yahoo();
  175. }, 1000);
  176. }
  177. if (ssss.contains("dndbeyond"))
  178. {
  179. dndbeyond();
  180. window.setInterval(function ()
  181. {
  182. dndbeyond();
  183. }, 1000);
  184. }
  185.  
  186. if (ssss.contains("alltrails"))
  187. {
  188. alltrails();
  189. window.setInterval(function ()
  190. {
  191. alltrails();
  192. }, 1000);
  193. }
  194.  
  195.  
  196.  
  197.  
  198.