diff --git a/src/js/background.js b/src/js/background.js index a8b5872..1e307d6 100755 --- a/src/js/background.js +++ b/src/js/background.js @@ -7,7 +7,8 @@ const restrictions = { 'seekingalpha.com': /.+seekingalpha\.com\/article\/.+/, 'techinasia.com': /\.techinasia\.com\/.+/, 'ft.com': /.+\.ft.com\/content\//, - 'nytimes.com': /^((?!\/timesmachine\.nytimes\.com\/).)*$/ + 'nytimes.com': /^((?!\/timesmachine\.nytimes\.com\/).)*$/, + 'theatlantic.com': /^((?!\/newsletters\.theatlantic\.com\/).)*$/ }; // Don't remove cookies before page load @@ -231,7 +232,8 @@ const blockedRegexes = { 'japantimes.co.jp': /cdn\.cxense\.com\//, 'scmp.com': /(\.tinypass\.com\/|cdn\.ampproject\.org\/v\d\/amp-access-.+\.js)/, 'ilmessaggero.it': /(utils\.cedsdigital\.it\/js\/PaywallMeter\.js)/, - 'washingtonpost.com': /\.washingtonpost\.com\/tetro\/metering\/evaluate/ + 'washingtonpost.com': /\.washingtonpost\.com\/tetro\/metering\/evaluate/, + 'theatlantic.com': /cdn\.theatlantic\.com\/_next\/static\/chunks\/pages\/.+\/archive\// }; const userAgentDesktop = 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)'; diff --git a/src/js/contentScript.js b/src/js/contentScript.js index 20d6bb7..606846a 100755 --- a/src/js/contentScript.js +++ b/src/js/contentScript.js @@ -446,14 +446,10 @@ if (matchDomain('elmercurio.com')) { }); }, 1000); // Delay (in milliseconds) } else if (matchDomain('theatlantic.com')) { - // Remove all nudge elements - document.querySelectorAll('div[class*="c-nudge"]').forEach(function (el) { - removeDOMElement(el); - }); - // Remove all FancyBox ads - document.querySelectorAll('div[class*="fancybox"]').forEach(function (el) { - removeDOMElement(el); - }); + const images = document.querySelectorAll('img[class*="Image_lazy__"]'); + for (const elem of images) { removeClassesByPrefix(elem, 'Image_lazy__'); } + const banners = document.querySelectorAll('.c-nudge__container, .c-non-metered-nudge, div[class^="ArticleInjector_"]'); + hideDOMElement(...banners); } else if (matchDomain('theathletic.com')) { if (!window.location.search.match(/(\?|&)amp/)) { const paywall = document.querySelector('div#slideup-paywall');