Greasy Fork is available in English.

Ads DOM Remover

Removes Ad Containers from DOM (doesn't replace adblocker extension, but blocks dynamic content which the adblocker fails to block by removing whole sections from the HTML DOM.)

  1. // ==UserScript==
  2. // @name Ads DOM Remover
  3. // @namespace sagiegurari
  4. // @version 1.38
  5. // @author Sagie Gur-Ari
  6. // @description Removes Ad Containers from DOM (doesn't replace adblocker extension, but blocks dynamic content which the adblocker fails to block by removing whole sections from the HTML DOM.)
  7. // @homepage https://github.com/sagiegurari/userscripts-ads-dom-remover
  8. // @supportURL https://github.com/sagiegurari/userscripts-ads-dom-remover/issues
  9. // @match https://www.ynet.co.il/*
  10. // @match https://www.mynet.co.il/*
  11. // @match https://www.calcalist.co.il/*
  12. // @match https://www.globes.co.il/*
  13. // @match https://sourceforge.net/projects/*/download*
  14. // @match https://sourceforge.net/projects/*/postdownload*
  15. // @match https://*.wikipedia.org/*
  16. // @match https://*.techonthenet.com/*
  17. // @match https://*.wikia.com/wiki/*
  18. // @match https://*.reddit.com/*
  19. // @match https://*.youtube.com/*
  20. // @match https://*.geeksforgeeks.org/*
  21. // @match https://*.bostonglobe.com/*
  22. // @match https://*.aternos.org/*
  23. // @match https://aternos.org/*
  24. // @require https://code.jquery.com/jquery-2.2.2.min.js
  25. // @require https://greasyfork.org/scripts/18490-ads-dom-remover-runner/code/Ads%20DOM%20Remover%20Runner.js?version=983896
  26. // @grant none
  27. // @license MIT License
  28. // ==/UserScript==
  29.  
  30. (function run($, runner) {
  31. 'use strict';
  32.  
  33. var selectorDefinitions = {
  34. test: {
  35. // the test selector definition is only used for testing
  36. hostNames: [
  37. '__tests1__',
  38. '__tests2__'
  39. ],
  40. selectors: {
  41. options: {
  42. loops: 1,
  43. interval: 1
  44. },
  45. selectors: [
  46. '.ad1',
  47. '.ad2'
  48. ]
  49. }
  50. },
  51. ynet: {
  52. hostNames: [
  53. 'ynet',
  54. 'calcalist'
  55. ],
  56. selectors: [
  57. '#colorbox',
  58. '#cboxOverlay',
  59. '#ads.premium',
  60. '#articleLayoutrightsidtable',
  61. '#google_image_div',
  62. 'img[src*="dynamicyield"]',
  63. 'div.MSCmainContent',
  64. '[id*="arketingCarouse"]',
  65. '[id*="arketingRecommended"]',
  66. '.mainVerticalArticleSharingLinks',
  67. '.OUTBRAIN',
  68. '.topBannerWrap',
  69. '.block.B3 .B3.ghcite.dyother.dyMonitor div',
  70. '.bigdealhomepage',
  71. '#ww6s_Main',
  72. '.buyandsavedy',
  73. '.area.footer.ghcite',
  74. '.hdr_set_homepage',
  75. '#c1_Hor',
  76. '#c2_Hor',
  77. '#c3_Hor',
  78. '#c4_Hor',
  79. '#c5_Hor',
  80. '#c6_Hor',
  81. '.homepagevideo-x6',
  82. '.buyandsave',
  83. '.general-image',
  84. '.PhotoArticlesTalkbacks',
  85. '[name="ExternalWebpageIframe"]',
  86. '#PROCOIL_SearchForm',
  87. '#magazines1024',
  88. '[id^="promo_"]',
  89. '[id^="ads."]',
  90. '[class*="facebook"]',
  91. '[class*="WinWin"]',
  92. '.main_search_radio',
  93. 'tr td [id^="ads."]',
  94. '.art-action-wrp',
  95. '.header-user-profile',
  96. '.left-art-content',
  97. '[class*="GeneralBanner"]',
  98. '#vilon',
  99. '#prime.shook',
  100. '#articlebottomsharinglinks',
  101. '.floatingPlayerimReallyDummy_container',
  102. '#ynet_user_login',
  103. '[title="YouTube"]',
  104. '[title="facebook"]',
  105. '#INDbtnWrap',
  106. '.YnetPremiumHeaderLogin',
  107. '.CreditLogos',
  108. '.tp-modal',
  109. {
  110. selector: '.homepagelitevideo',
  111. fineTuneSelector: function ($element) {
  112. return $element.parent().parent();
  113. }
  114. },
  115. {
  116. selector: 'iframe',
  117. fineTuneSelector: function ($element) {
  118. return $element.filter(function () {
  119. return !$(this).parent().hasClass('news_ticker_iframe');
  120. });
  121. }
  122. },
  123. {
  124. selector: 'div.B2b.block div',
  125. pre: function ($element) {
  126. $element.parent().css({
  127. height: '1px'
  128. });
  129. }
  130. }
  131. ]
  132. },
  133. globes: {
  134. hostNames: 'globes',
  135. selectors: [
  136. '#chromeWindow',
  137. {
  138. selector: 'iframe',
  139. filter: function ($element) {
  140. return $element.not('#GlobalFinanceData_home[src~=/news/]');
  141. }
  142. }
  143. ]
  144. },
  145. techonthenet: {
  146. hostNames: 'techonthenet.com',
  147. selectors: ['.adsblocked']
  148. },
  149. sourceforge: {
  150. hostNames: 'sourceforge.net',
  151. selectors: [
  152. '#content-for-adblock',
  153. '#newsletter-floating',
  154. '#page-body'
  155. ]
  156. },
  157. wikipedia: {
  158. hostNames: 'wikipedia.org',
  159. selectors: [
  160. '#frbanner',
  161. '#frb-inline',
  162. '#wlm-banner',
  163. '#centralNotice',
  164. '.frb-main',
  165. '.frbanner',
  166. '.frm',
  167. '.frb'
  168. ]
  169. },
  170. wikia: {
  171. hostNames: 'wikia.com',
  172. selectors: [
  173. '.WikiaFooter',
  174. '.WikiaRail',
  175. '.wds-global-footer'
  176. ]
  177. },
  178. reddit: {
  179. hostNames: 'reddit.com',
  180. selectors: [
  181. '#onboarding-splash',
  182. '[id^="google_ads"]'
  183. ]
  184. },
  185. youtube: {
  186. hostNames: 'youtube.com',
  187. selectors: [
  188. '#masthead-ad',
  189. '.video-ads ytp-ad-module',
  190. '.ytp-ad-overlay-ad-info-dialog-container',
  191. '.ytp-ad-overlay-slot',
  192. ],
  193. options: {
  194. loops: 200,
  195. interval: 2500
  196. }
  197. },
  198. geeksforgeeks: {
  199. hostNames: 'geeksforgeeks.org',
  200. selectors: [
  201. '.login-modal-div',
  202. '[aria-label=cookieconsent]'
  203. ]
  204. },
  205. bostonglobe: {
  206. hostNames: 'bostonglobe.com',
  207. selectors: [
  208. '.meter-social-connect',
  209. '.meter-social-connect__container'
  210. ]
  211. },
  212. aternos: {
  213. hostNames: 'aternos.org',
  214. selectors: [
  215. '.ad',
  216. '.header-ad'
  217. ]
  218. }
  219. };
  220.  
  221. [
  222. '#dcPremiumRightImg',
  223. '.boulevard',
  224. '#multiarticles-9',
  225. '#multiarticles-12',
  226. '#multiarticles-13',
  227. '#multiarticles-14',
  228. '#multiarticles-15',
  229. '#multiarticles-16',
  230. '.CdaMostViews',
  231. '.CdaCalcalistToday',
  232. '.CdaRecomendedMovies',
  233. '#SpecialBuilder1280',
  234. '.cdaFooter1280'
  235. ].forEach(function addSelector(selector) {
  236. selectorDefinitions.ynet.selectors.push({
  237. selector: selector,
  238. fineTuneSelector: function ($element) {
  239. return $element.parent();
  240. }
  241. });
  242. });
  243.  
  244. runner(
  245. $, {
  246. getSelectorDefinitions: function () {
  247. return selectorDefinitions;
  248. }
  249. }
  250. );
  251. }(
  252. window.jQuery.noConflict(true),
  253. window.adrRunner
  254. ));