From a93a4beb34d6143a6260367679c08c53531faa1d Mon Sep 17 00:00:00 2001 From: Adam <36013816+iamadamdev@users.noreply.github.com> Date: Sun, 15 Oct 2023 13:57:55 -0700 Subject: [PATCH] Fix latimes.com --- src/js/background.js | 2 +- src/js/contentScript.js | 12 ++---------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/js/background.js b/src/js/background.js index ff5c28f..a8b5872 100755 --- a/src/js/background.js +++ b/src/js/background.js @@ -226,7 +226,7 @@ const blockedRegexes = { '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\/)/, 'nytimes.com': /(\.nytimes\.com\/meter\.js|mwcm\.nyt\.com\/.+\.js|cooking\.nytimes\.com\/api\/.+\/access)/, - 'latimes.com': /(metering\.platform\.latimes\.com\/|cdn\.ampproject\.org\/v\d\/amp-(access|subscriptions)-.+\.js)/, + 'latimes.com': /\.californiatimes\.com\/meteringjs/, 'theathletic.com': /cdn\.ampproject\.org\/v\d\/amp-(access|subscriptions)-.+\.js/, 'japantimes.co.jp': /cdn\.cxense\.com\//, 'scmp.com': /(\.tinypass\.com\/|cdn\.ampproject\.org\/v\d\/amp-access-.+\.js)/, diff --git a/src/js/contentScript.js b/src/js/contentScript.js index 369f1c6..20d6bb7 100755 --- a/src/js/contentScript.js +++ b/src/js/contentScript.js @@ -641,16 +641,8 @@ if (matchDomain('elmercurio.com')) { body.removeAttribute('class'); } } else if (matchDomain('latimes.com')) { - const paywall = document.querySelector('metering-modal'); - const incognitoWall = document.querySelector('metering-toppanel'); - if (paywall) { - removeDOMElement(paywall); - } else if (incognitoWall) { - removeDOMElement(incognitoWall); - } - if (paywall || incognitoWall) { - document.body.removeAttribute('style'); - } + const ads = document.querySelectorAll('div.enhancement, div.google-dfp-ad-wrapper'); + hideDOMElement(...ads); } else if (matchDomain('foreignpolicy.com')) { const contentUngated = document.querySelector('div.content-ungated'); removeDOMElement(contentUngated);