Fix WaPo (images)

merge-requests/2/head
magnolia1234 3 years ago
parent 4feb3aee7c
commit 61c4adb94e

@ -421,7 +421,7 @@ var blockedRegexes = {
'variety.com': /cdn\.cxense\.com\//,
'velonews.com': /\.velonews\.com\/.+\/scripts\/contentGate.+\.js/,
'venturebeat.com': /\.wallkit\.net\/js\//,
'washingtonpost.com': /(\.washingtonpost\.com\/.+\/(default-article\/.+\/load_immediately|jqmodal)\/.+\.js|cdn\.ampproject\.org\/.+\/v\d\/amp-(access|(sticky-)?ad|subscriptions)-.+\.js)/,
'washingtonpost.com': /\.washingtonpost\.com\/pwapiv2\/article/,
'westfalen-blatt.de': /cdn\.ampproject\.org\/.+\/v\d\/amp-(ad|subscriptions)-.+\.js/,
'wired.com': /cdn\.ampproject\.org\/v\d\/amp-(ad|subscriptions)-.+\.js/,
'wn.de': /cdn\.ampproject\.org\/v\d\/amp-(ad|subscriptions)-.+\.js/,
@ -1276,7 +1276,7 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) {
let usa_today_site = (matchUrlDomain('gannett-cdn.com', details.url) && matchUrlDomain(['usatoday.com'], header_referer));
allow_ext_source = allow_ext_source || inkl_site || cl_elmerc_site || es_elesp_site || it_repubblica_site || usa_law360_site || usa_mw_site || usa_natgeo_site || usa_today_site;
bpc_amp_site = (matchUrlDomain('cdn.ampproject.org', details.url) && matchUrlDomain(['aachener-zeitung.de', 'asiatimes.com', 'augsburger-allgemeine.de', 'barrons.com', 'belfasttelegraph.co.uk', 'cicero.de', 'cmjornal.pt', 'economist.com', 'elpais.com', 'elperiodico.com', 'freiepresse.de', 'ft.com', 'handelsblatt.com', 'ilfattoquotidiano.it', 'inc42.com', 'independent.ie', 'la-croix.com', 'marketwatch.com', 'nationalreview.com', 'noz.de', 'nwzonline.de', 'scmp.com', 'seekingalpha.com', 'shz.de', 'staradvertiser.com', 'svz.de', 'telegraph.co.uk', 'washingtonpost.com', 'westfalen-blatt.de', 'wired.com', 'wn.de', 'wsj.com'].concat(amp_unhide, au_news_corp_domains, au_nine_domains, de_madsack_domains, es_epiberica_domains, es_grupo_vocento_domains, es_unidad_domains, fr_groupe_ebra_domains, fr_groupe_la_depeche_domains, it_repubblica_domains, usa_mcc_domains, usa_mng_domains, usa_theathletic_domains), header_referer));
bpc_amp_site = matchUrlDomain('cdn.ampproject.org', details.url) && (enabledSites.includes('cdn.ampproject.org') || matchUrlDomain(defaultSites_domains.concat(amp_unhide), header_referer));
}
if (!isSiteEnabled(details) && !allow_ext_source && !bpc_amp_site && !au_swm_site) {
@ -1387,7 +1387,7 @@ if (matchUrlDomain(change_headers, details.url) && (!['font', 'image', 'styleshe
}
if ((!['font', 'stylesheet'].includes(details.type) || matchUrlDomain(cs_limit_except, currentTabUrl)) && !csDone) {
let lib_file = 'lib/empty.js';
if (matchUrlDomain(['bloomberg.com', 'cicero.de', 'economictimes.com', 'lesechos.fr', 'marianne.net', 'newleftreview.org', 'newyorker.com', 'nzherald.co.nz', 'prospectmagazine.co.uk', 'stratfor.com', 'sudouest.fr', 'techinasia.com', 'valor.globo.com', 'washingtonpost.com'].concat(nl_mediahuis_region_domains, no_nhst_media_domains, usa_theathletic_domains), currentTabUrl))
if (matchUrlDomain(['bloomberg.com', 'cicero.de', 'economictimes.com', 'lesechos.fr', 'marianne.net', 'newleftreview.org', 'newyorker.com', 'nzherald.co.nz', 'prospectmagazine.co.uk', 'stratfor.com', 'sudouest.fr', 'techinasia.com', 'valor.globo.com'].concat(nl_mediahuis_region_domains, no_nhst_media_domains, usa_theathletic_domains), currentTabUrl))
lib_file = 'lib/purify.min.js';
var bg2csData = {
optin_setcookie: optin_setcookie,

@ -2,6 +2,7 @@
Changelog Bypass Paywalls Clean - Firefox
Post-release
Fix WaPo (images)
Fix WSJ (timing)
* v2.4.2.0 (2021-10-31)

@ -2801,11 +2801,6 @@ else if (matchDomain('venturebeat.com')) {
}
else if (matchDomain('washingtonpost.com')) {
window.setTimeout(function () {
let leaderboard = document.querySelector('#leaderboard-wrapper');
let adverts = document.querySelectorAll('div[data-qa="article-body-ad"]');
removeDOMElement(leaderboard, ...adverts);
}, 500); // Delay (in milliseconds)
if (location.href.includes('/gdpr-consent/')) {
let free_button = document.querySelector('.gdpr-consent-container .continue-btn.button.free');
if (free_button)
@ -2819,32 +2814,9 @@ else if (matchDomain('washingtonpost.com')) {
}
}, 300); // Delay (in milliseconds)
} else {
function wapo_main(node) {
removeDOMElement(node);
if (!url.match(/\/(graphics|interactive)\//)) {
let url_amp = url.split('?')[0] + '?outputType=amp';
replaceDomElementExt(url_amp, false, false, 'div.article-body', 'Failed to load from amp-page: ');
window.scrollTo(0, 0);
}
}
function wapo_overlay(node) {
node.removeAttribute('style');
}
let url = window.location.href;
if (!url.includes('outputType=amp')) {
waitDOMElement('div[id^="paywall-"], div.wp_signin, div#wp_Signin', 'DIV', wapo_main, false);
waitDOMElement('div[data-qa*="wall"]', 'DIV', removeDOMElement, true);
window.setTimeout(function () {
waitDOMAttribute('body', 'BODY', 'style', wapo_overlay, true);
}, 500); // Delay (in milliseconds)
waitDOMAttribute('html', 'HTML', 'style', wapo_overlay, false);
if (!url.match(/\/(graphics|interactive)\//))
csDoneOnce = true;
} else {
let subscr_sections = document.querySelectorAll('[subscriptions-section="content"]');
for (let subscr_section of subscr_sections)
subscr_section.removeAttribute('subscriptions-section');
}
let leaderboard = document.querySelector('#leaderboard-wrapper');
let adverts = document.querySelectorAll('div[data-qa$="-ad"]');
removeDOMElement(leaderboard, ...adverts);
}
}
@ -3013,9 +2985,6 @@ function replaceDomElementExt(url, proxy, base64, selector, text_fail = '') {
html = decode_utf8(atob(html));
selector = 'body';
}
if (matchDomain(['washingtonpost.com']) && html.includes('<amp-')) {
html = html.replace(/<amp-/g, '<').replace(/<\/amp-/g, '</');
}
let parser = new DOMParser();
let doc = parser.parseFromString(DOMPurify.sanitize(html, {ADD_ATTR: ['layout'], ADD_TAGS: ['amp-img']}), 'text/html');
//console.log(DOMPurify.removed);

@ -556,5 +556,5 @@
"*://*.wallkit.net/*",
"*://*.wsj.net/*"
],
"version": "2.4.2.0"
"version": "2.4.2.1"
}
Loading…
Cancel
Save