Skip to content

Commit

Permalink
Fix theatlantic.com
Browse files Browse the repository at this point in the history
  • Loading branch information
iamadamdev committed Oct 15, 2023
1 parent a93a4be commit 7029ba3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
6 changes: 4 additions & 2 deletions src/js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)';
Expand Down
12 changes: 4 additions & 8 deletions src/js/contentScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 7029ba3

Please sign in to comment.