Fix theatlantic.com

This commit is contained in:
Adam 2023-10-15 14:08:06 -07:00
parent a93a4beb34
commit 7029ba34ef
2 changed files with 8 additions and 10 deletions

View File

@ -7,7 +7,8 @@ const restrictions = {
'seekingalpha.com': /.+seekingalpha\.com\/article\/.+/, 'seekingalpha.com': /.+seekingalpha\.com\/article\/.+/,
'techinasia.com': /\.techinasia\.com\/.+/, 'techinasia.com': /\.techinasia\.com\/.+/,
'ft.com': /.+\.ft.com\/content\//, '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 // Don't remove cookies before page load
@ -231,7 +232,8 @@ const blockedRegexes = {
'japantimes.co.jp': /cdn\.cxense\.com\//, 'japantimes.co.jp': /cdn\.cxense\.com\//,
'scmp.com': /(\.tinypass\.com\/|cdn\.ampproject\.org\/v\d\/amp-access-.+\.js)/, 'scmp.com': /(\.tinypass\.com\/|cdn\.ampproject\.org\/v\d\/amp-access-.+\.js)/,
'ilmessaggero.it': /(utils\.cedsdigital\.it\/js\/PaywallMeter\.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)'; const userAgentDesktop = 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)';

View File

@ -446,14 +446,10 @@ if (matchDomain('elmercurio.com')) {
}); });
}, 1000); // Delay (in milliseconds) }, 1000); // Delay (in milliseconds)
} else if (matchDomain('theatlantic.com')) { } else if (matchDomain('theatlantic.com')) {
// Remove all nudge elements const images = document.querySelectorAll('img[class*="Image_lazy__"]');
document.querySelectorAll('div[class*="c-nudge"]').forEach(function (el) { for (const elem of images) { removeClassesByPrefix(elem, 'Image_lazy__'); }
removeDOMElement(el); const banners = document.querySelectorAll('.c-nudge__container, .c-non-metered-nudge, div[class^="ArticleInjector_"]');
}); hideDOMElement(...banners);
// Remove all FancyBox ads
document.querySelectorAll('div[class*="fancybox"]').forEach(function (el) {
removeDOMElement(el);
});
} else if (matchDomain('theathletic.com')) { } else if (matchDomain('theathletic.com')) {
if (!window.location.search.match(/(\?|&)amp/)) { if (!window.location.search.match(/(\?|&)amp/)) {
const paywall = document.querySelector('div#slideup-paywall'); const paywall = document.querySelector('div#slideup-paywall');