Fix WaPo (amp)

This commit is contained in:
magnolia1234 2021-07-05 19:45:08 +02:00
parent d8b42a4aa0
commit 654f3b15ea
4 changed files with 15 additions and 8 deletions

View file

@ -401,6 +401,7 @@ var blockedRegexes = {
'variety.com': /cdn\.cxense\.com\//,
'velonews.com': /\.velonews\.com\/.+\/scripts\/contentGate.+\.js/,
'venturebeat.com': /\.wallkit\.net\/js\//,
'washingtonpost.com': /cdn\.ampproject\.org\/.+\/v\d\/amp-((sticky-)?ad|subscriptions)-.+\.js/,
'wsj.com': /(cdn\.ampproject\.org\/v\d\/amp-(access|ad|consent)-.+\.js|cdn\.cxense\.com\/)/
};
@ -1123,7 +1124,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 || uk_nlr_site || usa_discmag_site || usa_mw_site || usa_natgeo_site || usa_today_site;
bpc_amp_site = (matchUrlDomain('cdn.ampproject.org', details.url) && matchUrlDomain(['asiatimes.com', 'augsburger-allgemeine.de', 'barrons.com', 'belfasttelegraph.co.uk', 'cicero.de', 'cmjornal.pt', 'elmundo.es', 'elpais.com', 'elperiodico.com', 'expansion.com', 'freiepresse.de', 'independent.ie', 'irishtimes.com', 'la-croix.com', 'marketwatch.com', 'nationalreview.com', 'noz.de', 'nwzonline.de', 'scmp.com', 'seekingalpha.com', 'shz.de', 'staradvertiser.com', 'sueddeutsche.de', 'svz.de', 'telegraph.co.uk'].concat(au_news_corp_domains, au_nine_domains, de_madsack_domains, es_epiberica_domains, es_grupo_vocento_domains, fr_groupe_ebra_domains, fr_groupe_la_depeche_domains, it_repubblica_domains, usa_mcc_domains, usa_theathletic_domains), header_referer));
bpc_amp_site = (matchUrlDomain('cdn.ampproject.org', details.url) && matchUrlDomain(['asiatimes.com', 'augsburger-allgemeine.de', 'barrons.com', 'belfasttelegraph.co.uk', 'cicero.de', 'cmjornal.pt', 'elmundo.es', 'elpais.com', 'elperiodico.com', 'expansion.com', 'freiepresse.de', 'independent.ie', 'irishtimes.com', 'la-croix.com', 'marketwatch.com', 'nationalreview.com', 'noz.de', 'nwzonline.de', 'scmp.com', 'seekingalpha.com', 'shz.de', 'staradvertiser.com', 'sueddeutsche.de', 'svz.de', 'telegraph.co.uk', 'washingtonpost.com'].concat(au_news_corp_domains, au_nine_domains, de_madsack_domains, es_epiberica_domains, es_grupo_vocento_domains, fr_groupe_ebra_domains, fr_groupe_la_depeche_domains, it_repubblica_domains, usa_mcc_domains, usa_theathletic_domains), header_referer));
}
if (!isSiteEnabled(details) && !allow_ext_source && !bpc_amp_site && !au_apn_site && !au_swm_site) {

View file

@ -2,6 +2,7 @@
Changelog Bypass Paywalls Clean - Firefox
Post-release
Fix WaPo (amp)
* v2.2.8.0 (2021-07-04)
Fix Le Parisien (Googlebot)

View file

@ -1315,7 +1315,7 @@ else if (matchDomain(nl_mediahuis_region_domains)) {
par_elem = document.createElement('div');
let par_img = document.createElement('img');
par_img.src = par_key.url;
par_elem.appendChild(par_img)
par_elem.appendChild(par_img);
par_div = document.createElement('div');
par_div.innerText = par[key].caption ? par[key].caption : '';
par_div.innerText += par[key].credit ? '\n' + par[key].credit : '';
@ -2511,12 +2511,17 @@ else if (matchDomain('washingtonpost.com')) {
} else {
function wapo_main(node) {
removeDOMElement(node);
let url = window.location.href;
if (!url.includes('outputType=amp'))
window.location.href = url.split('?')[0] + '?outputType=amp';
window.location.href = url.split('?')[0] + '?outputType=amp';
}
let url = window.location.href;
if (!url.includes('outputType=amp')) {
waitDOMElement('div[id^="paywall-"]', 'DIV', wapo_main, false);
csDoneOnce = true;
} else {
let subscr_sections = document.querySelectorAll('[subscriptions-section="content"]');
for (let subscr_section of subscr_sections)
subscr_section.removeAttribute('subscriptions-section');
}
waitDOMElement('div[id^="paywall-"]', 'DIV', wapo_main, false);
csDoneOnce = true;
}
}

View file

@ -536,5 +536,5 @@
"*://*.wallkit.net/*",
"*://*.wsj.net/*"
],
"version": "2.2.8.0"
"version": "2.2.8.1"
}