Fix group McClatchy (unlisted sites)

This commit is contained in:
magnolia1234 2021-08-10 19:11:51 +02:00
parent 72b957b2d9
commit 15543ae001
4 changed files with 12 additions and 7 deletions

View File

@ -976,7 +976,7 @@ ext_api.webRequest.onHeadersReceived.addListener(function (details) {
}, },
['blocking', 'responseHeaders']); ['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 = [];
var block_js_custom_ext = []; var block_js_custom_ext = [];
var block_js = block_js_default.concat(block_js_custom); 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) // 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) { 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)) { 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); usa_mcc_domains.push(mcc_domain);
if (!enabledSites.includes(mcc_domain)) if (!enabledSites.includes(mcc_domain))
enabledSites.push(mcc_domain); enabledSites.push(mcc_domain);

View File

@ -2,6 +2,7 @@
Changelog Bypass Paywalls Clean - Firefox Changelog Bypass Paywalls Clean - Firefox
Post-release Post-release
Fix group McClatchy (unlisted sites)
Fix MediaNama (modal) Fix MediaNama (modal)
* v2.3.2.0 (2021-08-08) * v2.3.2.0 (2021-08-08)

View File

@ -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) if (!domain)
domain = document.domain.replace(/(account|amp)\./, ''); domain = document.domain.replace(/(account|amp)\./, '');
let url = window.location.href; let url = window.location.href;
@ -2855,7 +2855,6 @@ function matchDomain(domains, hostname) {
return matched_domain; return matched_domain;
} }
// add domains to manifest (content_scripts - matches)
function replaceDomElementExt(url, proxy, base64, selector, text_fail = '') { function replaceDomElementExt(url, proxy, base64, selector, text_fail = '') {
let proxyurl = proxy ? 'https://bpc2-cors-anywhere.herokuapp.com/' : ''; let proxyurl = proxy ? 'https://bpc2-cors-anywhere.herokuapp.com/' : '';
fetch(proxyurl + url, {headers: {"Content-Type": "text/plain", "X-Requested-With": "XMLHttpRequest"} }) fetch(proxyurl + url, {headers: {"Content-Type": "text/plain", "X-Requested-With": "XMLHttpRequest"} })

View File

@ -533,14 +533,17 @@
"*://*.jsdelivr.net/*", "*://*.jsdelivr.net/*",
"*://*.lightboxcdn.com/*", "*://*.lightboxcdn.com/*",
"*://*.loader-cdn.azureedge.net/*", "*://*.loader-cdn.azureedge.net/*",
"*://*.mcclatchy-wires.com/*",
"*://*.mcclatchyinteractive.com/*",
"*://*.natgeofe.com/*", "*://*.natgeofe.com/*",
"*://*.nyt.com/*", "*://*.nyt.com/*",
"*://*.pasedigital.cl/*", "*://*.pasedigital.cl/*",
"*://*.rcsobjects.it/*", "*://*.rcsobjects.it/*",
"*://*.repstatic.it/*", "*://*.repstatic.it/*",
"*://*.rndtech.de/*",
"*://*.userzoom.com/*", "*://*.userzoom.com/*",
"*://*.wallkit.net/*", "*://*.wallkit.net/*",
"*://*.wsj.net/*" "*://*.wsj.net/*"
], ],
"version": "2.3.2.1" "version": "2.3.2.2"
} }