Fix NY Times Cooking

This commit is contained in:
Adam 2022-09-08 11:20:53 -07:00
parent 5adc770a05
commit e15bc95ae4
2 changed files with 4 additions and 12 deletions

View File

@ -242,7 +242,8 @@ const blockedRegexes = {
'expansion.com': /cdn\.ampproject\.org\/v\d\/amp-(access|ad|consent)-.+\.js/,
'chicagobusiness.com': /(\.tinypass\.com\/|\.chicagobusiness\.com\/.+\/js\/js_.+\.js)/,
'dailytelegraph.com.au': /cdn\.ampproject\.org\/v\d\/amp-(access|ad|consent)-.+\.js/,
'theglobeandmail.com': /(\.theglobeandmail\.com\/pf\/dist\/engine\/react\.js|smartwall\.theglobeandmail\.com\/)/
'theglobeandmail.com': /(\.theglobeandmail\.com\/pf\/dist\/engine\/react\.js|smartwall\.theglobeandmail\.com\/)/,
'nytimes.com': /(meter-svc\.nytimes\.com\/meter\.js|mwcm\.nyt\.com\/.+\.js|cooking\.nytimes\.com\/api\/.+\/access)/
};
const userAgentDesktop = 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)';

View File

@ -261,17 +261,8 @@ if (matchDomain('elmercurio.com')) {
removeDOMElement(counter, coBanner, support);
});
} else if (matchDomain('nytimes.com')) {
const previewButton = document.querySelector('.css-3s1ce0');
if (previewButton) { previewButton.click(); }
blockElement('.css-3fbowa'); // Prevent bottom dock from appearing
blockElement('#gateway-content'); // Remove paywall
blockElement('.css-1bd8bfl'); // Remove filter
// Restore scrolling
document.onreadystatechange = function () {
if (document.readyState === 'complete') {
document.querySelector('.css-mcm29f').setAttribute('style', 'position:relative');
}
};
const banners = document.querySelectorAll('div[data-testid="inline-message"], div[id^="ad-"], div.expanded-dock');
removeDOMElement(...banners);
} else if (matchDomain('technologyreview.com')) {
window.setTimeout(function () {
const bodyObscured = document.querySelector('body[class*="body__obscureContent"]');