Fix Wired (amp)

master
magnolia1234 2021-10-23 09:58:56 +02:00
parent 8399214273
commit 18af602fed
3 changed files with 21 additions and 2 deletions

View File

@ -423,6 +423,7 @@ var blockedRegexes = {
'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)/,
'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/,
'wsj.com': /(cdn\.ampproject\.org\/v\d\/amp-(access|ad|consent|subscriptions)-.+\.js|cdn\.cxense\.com\/)/
};
@ -1277,7 +1278,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', '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) && 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));
}
if (!isSiteEnabled(details) && !allow_ext_source && !bpc_amp_site && !au_swm_site) {

View File

@ -15,6 +15,7 @@ Fix La Croix (timing)
Fix The Globe and Mail
Fix The New Yorker (homepage)
Fix Trouw.nl (timing)
Fix Wired (amp)
Update custom sites (block regex for default sites)
* v2.4.0.0 (2021-10-17)

View File

@ -1628,8 +1628,12 @@ else if (matchDomain('bloomberg.com')) {
waitDOMElement('div#fortress-paywall-container-root', 'DIV', removeDOMElement, true);
waitDOMAttribute('body', 'BODY', 'data-paywall-overlay-status', bloomberg_noscroll, true);
sessionStorage.clear();
let paywall = document.querySelector('div#fortress-paywall-container-root');
let counter = document.querySelector('div#fortress-preblocked-container-root');
removeDOMElement(counter);
let noscroll = document.querySelector('body[data-paywall-overlay-status]');
if (noscroll)
noscroll.removeAttribute('data-paywall-overlay-status');
removeDOMElement(paywall, counter);
let url = window.location.href;
if (url.match(/\/(articles|features)\//)) {
let leaderboard = document.querySelector('div[id^="leaderboard"], div.leaderboard-wrapper');
@ -2790,6 +2794,19 @@ else if (matchDomain('washingtonpost.com')) {
}
}
else if (matchDomain('wired.com')) {
let url = window.location.href.split('?')[0];
if (url.endsWith('/amp')) {
let preview = document.querySelector('section[subscriptions-section="content-not-granted"]');
removeDOMElement(preview);
let subscr_section = document.querySelector('[subscriptions-section="content"]');
if (subscr_section)
subscr_section.removeAttribute('subscriptions-section');
let amp_ads = document.querySelectorAll('.ad');
removeDOMElement(...amp_ads);
}
}
else if (matchDomain('wsj.com')) {
let url = window.location.href;
if (location.href.includes('/articles/')) {