diff --git a/background.js b/background.js index 22ed2436..ebfc82da 100644 --- a/background.js +++ b/background.js @@ -976,7 +976,7 @@ ext_api.webRequest.onHeadersReceived.addListener(function (details) { }, ['blocking', 'responseHeaders']); -var block_js_default = ["*://cdn.tinypass.com/*", "*://*.piano.io/*", "*://*.poool.fr/*", "*://cdn.ampproject.org/v*/amp-access-*.js", "*://*.blueconic.net/*", "*://*.cxense.com/*", "*://*.evolok.net/*", "*://js.matheranalytics.com/*", "*://*.newsmemory.com/*", "*://*.onecount.net/*", "*://js.pelcro.com/*", "*://*.qiota.com/*", "*://*.tribdss.com/*"]; +var block_js_default = ["*://cdn.tinypass.com/*", "*://*.piano.io/*", "*://*.poool.fr/*", "*://cdn.ampproject.org/v*/amp-access-*.js", "*://cdn.ampproject.org/v*/amp-subscriptions-*.js", "*://*.blueconic.net/*", "*://*.cxense.com/*", "*://*.evolok.net/*", "*://js.matheranalytics.com/*", "*://*.newsmemory.com/*", "*://*.onecount.net/*", "*://js.pelcro.com/*", "*://*.qiota.com/*", "*://*.tribdss.com/*"]; var block_js_custom = []; var block_js_custom_ext = []; var block_js = block_js_default.concat(block_js_custom); @@ -1062,11 +1062,13 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) { } // block script for additional McClatchy sites (opt-in to custom sites) - var usa_mcc_domain = (matchUrlDomain('mcclatchyinteractive.com', details.url) && ['script'].includes(details.type) && !matchUrlDomain(usa_mcc_domains, header_referer) && enabledSites.includes('###_usa_mcc')); + var usa_mcc_domain = ((matchUrlDomain('mcclatchyinteractive.com', details.url) && ['script'].includes(details.type)) || + (matchUrlDomain('mcclatchy-wires.com', details.url) && ['image'].includes(details.type)) && + !matchUrlDomain(usa_mcc_domains, header_referer) && enabledSites.includes('###_usa_mcc')); if (usa_mcc_domain) { - let mcc_domain = urlHost(header_referer).replace('account.', ''); + let mcc_domain = urlHost(header_referer).replace(/^(account|amp)\./, ''); if (!usa_mcc_domains.includes(mcc_domain)) { - blockedRegexes[domain] = /(js\.matheranalytics\.com\/|cdn\.ampproject\.org\/v\d\/amp-subscriptions-.+\.js)/; + blockedRegexes[mcc_domain] = /(js\.matheranalytics\.com\/|cdn\.ampproject\.org\/v\d\/amp-subscriptions-.+\.js)/; usa_mcc_domains.push(mcc_domain); if (!enabledSites.includes(mcc_domain)) enabledSites.push(mcc_domain); diff --git a/changelog.txt b/changelog.txt index 0b9f9801..c364f901 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ Changelog Bypass Paywalls Clean - Firefox Post-release +Fix group McClatchy (unlisted sites) Fix MediaNama (modal) * v2.3.2.0 (2021-08-08) diff --git a/contentScript.js b/contentScript.js index 986f0b06..14d10203 100644 --- a/contentScript.js +++ b/contentScript.js @@ -2754,7 +2754,7 @@ else if (matchDomain('wsj.com') && !matchDomain('cn.wsj.com')) { } } -else if ((domain = matchDomain(usa_mcc_domains)) || document.querySelector('script[src^="https://media.mcclatchyinteractive.com/"]') || window.location.href.match(/\/\/amp\..+\.com\/(.+\/)?article(\d){8,}\.html/)) { +else if ((domain = matchDomain(usa_mcc_domains)) || document.querySelector('script[src^="https://media.mcclatchyinteractive.com/"]') || (window.location.href.match(/\/\/amp\..+\.com\/(.+\/)?article(\d){8,}\.html/) && document.querySelector('a[href^="https://classifieds.mcclatchy.com/"]'))) { if (!domain) domain = document.domain.replace(/(account|amp)\./, ''); let url = window.location.href; @@ -2855,7 +2855,6 @@ function matchDomain(domains, hostname) { return matched_domain; } -// add domains to manifest (content_scripts - matches) function replaceDomElementExt(url, proxy, base64, selector, text_fail = '') { let proxyurl = proxy ? 'https://bpc2-cors-anywhere.herokuapp.com/' : ''; fetch(proxyurl + url, {headers: {"Content-Type": "text/plain", "X-Requested-With": "XMLHttpRequest"} }) diff --git a/manifest.json b/manifest.json index ce2ac8ef..7c8571ab 100644 --- a/manifest.json +++ b/manifest.json @@ -533,14 +533,17 @@ "*://*.jsdelivr.net/*", "*://*.lightboxcdn.com/*", "*://*.loader-cdn.azureedge.net/*", + "*://*.mcclatchy-wires.com/*", + "*://*.mcclatchyinteractive.com/*", "*://*.natgeofe.com/*", "*://*.nyt.com/*", "*://*.pasedigital.cl/*", "*://*.rcsobjects.it/*", "*://*.repstatic.it/*", + "*://*.rndtech.de/*", "*://*.userzoom.com/*", "*://*.wallkit.net/*", "*://*.wsj.net/*" ], - "version": "2.3.2.1" + "version": "2.3.2.2" } \ No newline at end of file