//"use strict"; var ext_api = (typeof browser === 'object') ? browser : chrome; var domain; var csDone = false; var csDoneOnce = false; var ca_torstar_domains = ['niagarafallsreview.ca', 'stcatharinesstandard.ca', 'thepeterboroughexaminer.com', 'therecord.com', 'thespec.com', 'thestar.com', 'wellandtribune.ca']; var de_funke_media_domains = ['abendblatt.de', 'braunschweiger-zeitung.de', 'morgenpost.de', 'nrz.de', 'otz.de', 'thueringer-allgemeine.de', 'tlz.de', 'waz.de', 'wp.de', 'wr.de']; var de_madsack_domains = ['haz.de', 'kn-online.de', 'ln-online.de', 'lvz.de', 'maz-online.de', 'neuepresse.de', 'ostsee-zeitung.de']; var es_epiberica_domains = ['diariodeibiza.es', 'diariodemallorca.es', 'farodevigo.es', 'laprovincia.es', 'levante-emv.com', 'lne.es']; var es_grupo_vocento_domains = ['diariosur.es', 'diariovasco.com', 'elcomercio.es', 'elcorreo.com', 'eldiariomontanes.es', 'elnortedecastilla.es', 'hoy.es', 'ideal.es', 'larioja.com', 'lasprovincias.es', 'laverdad.es', 'lavozdigital.es']; var fr_groupe_ebra_domains = ['bienpublic.com', 'dna.fr', 'estrepublicain.fr', 'lalsace.fr', 'ledauphine.com', 'lejsl.com', 'leprogres.fr', 'republicain-lorrain.fr', 'vosgesmatin.fr']; var fr_groupe_la_depeche_domains = ['centrepresseaveyron.fr', 'ladepeche.fr', 'lindependant.fr', 'midi-olympique.fr', 'midilibre.fr', 'nrpyrenees.fr', 'petitbleu.fr']; var it_repubblica_domains = ['gelocal.it', 'ilsecoloxix.it', 'lanuovasardegna.it', 'lastampa.it', 'limesonline.com', 'repubblica.it']; var nl_mediahuis_region_domains = ['gooieneemlander.nl', 'haarlemsdagblad.nl', 'ijmuidercourant.nl', 'leidschdagblad.nl', 'noordhollandsdagblad.nl']; var usa_crainsbiz_domains = ['chicagobusiness.com', 'crainscleveland', 'crainsdetroit', 'crainsnewyork.com']; var usa_mcc_domains = ['bnd.com', 'charlotteobserver.com', 'fresnobee.com', 'kansas.com', 'kansascity.com', 'kentucky.com', 'miamiherald.com', 'newsobserver.com', 'sacbee.com', 'star-telegram.com', 'thestate.com', 'tri-cityherald.com']; var usa_tribune_domains = ['baltimoresun.com', 'chicagotribune.com', 'courant.com', 'dailypress.com', 'mcall.com', 'nydailynews.com', 'orlandosentinel.com', 'pilotonline.com', 'sun-sentinel.com']; // clean local storage of sites (with an exemption for hold-list) var arr_localstorage_hold = ['augsburger-allgemeine.de', 'charliehebdo.fr', 'cmjornal.pt', 'elmundo.es', 'expansion.com', 'houstonchronicle.com', 'irishtimes.com', 'kurier.at', 'nknews.org', 'seekingalpha.com', 'sfchronicle.com', 'thehindu.com', 'thetimes.co.uk']; arr_localstorage_hold = arr_localstorage_hold.concat(de_funke_media_domains, es_grupo_vocento_domains); if (!matchDomain(arr_localstorage_hold)) { window.localStorage.clear(); } var div_bpc_done = document.querySelector('div#bpc_done'); if (!div_bpc_done) { // listen to responses from background script if (ext_api.runtime && (matchDomain(['belfasttelegraph.co.uk', 'independent.ie']) || window.location.hostname.match(/\.(com|net)\.au$/))) { ext_api.runtime.onMessage.addListener(function (message, sender) { // setCookie opt-in if (message.optIn) { let hostname = window.location.hostname; if (hostname.match(/\.(com|net)\.au$/)) { // Australian Provincial Newspapers domain = window.location.hostname.replace('www.', ''); let au_apn_script = document.querySelector('script[src^="https://media.apnarm.net.au/"]'); if (au_apn_script || (domain = matchDomain(['news-mail.com.au', 'frasercoastchronicle.com.au', 'gladstoneobserver.com.au', 'dailyexaminer.com.au', 'dailymercury.com.au', 'themorningbulletin.com.au', 'sunshinecoastdaily.com.au', 'gympietimes.com.au', 'qt.com.au', 'warwickdailynews.com.au']))) if (!cookieExists('subscribed')) setCookie('subscribed', 'true', domain, '/', 14); } else { if (domain = matchDomain(['belfasttelegraph.co.uk', 'independent.ie'])) { if (!cookieExists('subscriber')) setCookie('subscriber', '{"subscriptionStatus": true}', domain, '/', 14); if (hostname.includes('amp.')) { let subscriber = document.querySelector('section[amp-access="subscriber"]'); if (subscriber) subscriber.removeAttribute('amp-access-hide'); let not_subscriber = document.querySelector('section[amp-access="NOT subscriber"]'); let amp_ads = document.querySelectorAll('amp-ad, amp-embed'); removeDOMElement(not_subscriber, ...amp_ads); } } } } }); // ask for opt-in confirmation ext_api.runtime.sendMessage({request: 'optin'}); } // Content workarounds/domain if (matchDomain(['medium.com', 'towardsdatascience.com']) || document.querySelector('script[src^="https://cdn-client.medium.com/"]')) { let paywall = document.querySelector('div#paywall-background-color'); removeDOMElement(paywall); if (paywall) ext_api.runtime.sendMessage({request: 'refreshCurrentTab'}); window.setTimeout(function () { let meter = document.querySelector('[id*="highlight-meter-"]'); if (meter) meter.hidden = true; }, 500); // Delay (in milliseconds) } else if (window.location.hostname.match(/\.(com|net)\.au$/)) {//australia if (matchDomain('thesaturdaypaper.com.au')) { let paywall = document.querySelector('div.paywall-hard-always-show'); removeDOMElement(paywall); } else if (domain = matchDomain(["brisbanetimes.com.au", "smh.com.au", "theage.com.au", "watoday.com.au"])) { let url = window.location.href; let for_subscribers = document.querySelector('meta[content^="FOR SUBSCRIBERS"]'); if (for_subscribers) { window.setTimeout(function () { window.location.href = url.replace('www.', 'amp.'); }, 500); // Delay (in milliseconds) } else if (url.includes('amp.' + domain)) { let subscr_sections = document.querySelectorAll('div[subscriptions-section="content"]'); for (let subscr_section of subscr_sections) { subscr_section.removeAttribute('subscriptions-section'); } let amp_ads = document.querySelectorAll('amp-ad'); removeDOMElement(...amp_ads); } } else { // Australian Community Media newspapers let au_cm_sites = ['bendigoadvertiser.com.au', 'bordermail.com.au', 'canberratimes.com.au', 'centralwesterndaily.com.au', 'dailyadvertiser.com.au', 'dailyliberal.com.au', 'examiner.com.au', 'illawarramercury.com.au', 'newcastleherald.com.au', 'northerndailyleader.com.au', 'portnews.com.au', 'standard.net.au', 'theadvocate.com.au', 'thecourier.com.au', 'westernadvocate.com.au']; let au_piano_script = document.querySelector('script[src="https://cdn-au.piano.io/api/tinypass.min.js"]'); if (matchDomain(au_cm_sites) || au_piano_script) { let subscribe_truncate = document.querySelector('.subscribe-truncate'); if (subscribe_truncate) subscribe_truncate.classList.remove('subscribe-truncate'); let subscriber_hiders = document.querySelectorAll('.subscriber-hider'); for (let subscriber_hider of subscriber_hiders) subscriber_hider.classList.remove('subscriber-hider'); let blocker = document.querySelector('div.blocker'); let noscroll = document.querySelector('body[style]'); if (noscroll) noscroll.removeAttribute('style'); let story_generic_iframe = document.querySelector('.story-generic__iframe'); removeDOMElement(story_generic_iframe, blocker); } else if (window.location.hostname.endsWith('.com.au')) { // Australia News Corp let au_nc_sites = ['adelaidenow.com.au', 'cairnspost.com.au', 'couriermail.com.au', 'dailytelegraph.com.au', 'geelongadvertiser.com.au', 'goldcoastbulletin.com.au', 'heraldsun.com.au', 'ntnews.com.au', 'theaustralian.com.au', 'thechronicle.com.au', 'themercury.com.au', 'townsvillebulletin.com.au', 'weeklytimesnow.com.au']; if (domain = matchDomain(au_nc_sites)) { let header_ads = document.querySelector('.header_ads-container'); removeDOMElement(header_ads); if (window.location.hostname.startsWith('amp.')) { let div_hidden_all = document.querySelectorAll('div[amp-access="access AND subscriber"]'); for (let div_hidden of div_hidden_all) div_hidden.removeAttribute('amp-access-hide'); } else if (window.location.href.includes('?amp')) { //window.setTimeout(function () { let div_hidden = document.querySelector('div[amp-access="subscriber AND status=\'logged-in\'"]'); if (div_hidden) div_hidden.removeAttribute('amp-access-hide'); //}, 500); // Delay (in milliseconds) } let amp_iframes = document.querySelectorAll('amp-iframe'); let elem; for (let amp_iframe of amp_iframes) { elem = document.createElement('a'); elem.innerText = 'Video-link'; elem.setAttribute('href', amp_iframe.getAttribute('src')); elem.setAttribute('target', '_blank'); amp_iframe.parentElement.insertBefore(elem, amp_iframe); removeDOMElement(amp_iframe); } let amp_ads = document.querySelectorAll('[id^="ad-mrec-"], amp-ad, amp-embed'); removeDOMElement(...amp_ads); } else { // Australian Seven West Media let swm_script = document.querySelector('script[src^="https://s.thewest.com.au"]'); if (matchDomain('thewest.com.au') || swm_script) { window.setTimeout(function () { let breach_screen = document.querySelector('div[data-testid*="BreachScreen"]'); if (breach_screen) { let scripts = document.querySelectorAll('script:not([src], [type])'); let json_script; for (let script of scripts) { if (script.innerText.includes('window.PAGE_DATA =')) { json_script = script; break; } } if (json_script) { let json_text = json_script.innerHTML.split('window.PAGE_DATA =')[1].split(' { if (response.ok) { response.text().then(html => { var parser = new DOMParser(); var doc = parser.parseFromString(html, 'text/html'); let json = doc.querySelector('script[id="schemaOrgJson"]'); if (json) { var json_text = json.text.replace(/(\r|\n)/g, ''); let split1 = json_text.split('"ArticleBody": "'); let split2 = split1[1].split('","author":'); if (split2[0].includes('"')) json_text = split1[0] + '"ArticleBody": "' + split2[0].replace(/"/g, '“') + '","author":' + split2[1]; try { json_text = JSON.parse(json_text).ArticleBody; } catch (err) { console.log(err); return; } if (!json_text) return; let article_text = document.querySelector('.art_txt.paywall,.atc-Text.js-atc-Text'); article_text.innerText = ''; const breakText = (str) => { str = str.replace(/(?:^|[A-Za-z\"\“])(\.|\?|!)(?=[A-ZÖÜ\„\d][A-Za-zÀ-ÿ\„\d]{1,})/gm, "$&\n\n"); str = str.replace(/(([a-z]{2,}|[\"\“]))(?=[A-Z](?=[A-Za-zÀ-ÿ]+))/gm, "$&\n\n"); // exceptions: names with alternating lower/uppercase (no general fix) let str_rep_arr = ['AstraZeneca', 'BaFin', 'BerlHG', 'BfArM', 'BilMoG', 'BioNTech', 'DiGA', 'EuGH', 'FinTechRat', 'GlaxoSmithKline', 'IfSG', 'medRxiv', 'PlosOne', 'StVO']; let str_rep_split, str_rep_src; for (let str_rep of str_rep_arr) { str_rep_split = str_rep.split(/([a-z]+)(?=[A-Z](?=[A-Za-z]+))/); str_rep_src = str_rep_split.reduce(function (accumulator, currentValue) { return accumulator + currentValue + ((currentValue !== currentValue.toUpperCase()) ? '\n\n' : ''); }); if (str_rep_src.endsWith('\n\n')) str_rep_src = str_rep_src.slice(0, -2); str = str.replace(new RegExp(str_rep_src, "g"), str_rep); } str = str.replace(/De\n\n([A-Z])/g, "De$1"); str = str.replace(/La\n\n([A-Z])/g, "La$1"); str = str.replace(/Le\n\n([A-Z])/g, "Le$1"); str = str.replace(/Mc\n\n([A-Z])/g, "Mc$1"); return str; }; json_text = breakText(json_text); json_text.split("\n\n").forEach( (p_text) => { let elem; if (p_text.length < 80) { elem = document.createElement("h2"); elem.setAttribute('class', 'atc-SubHeadline'); } else { elem = document.createElement("p"); elem.setAttribute('class', 'atc-TextParagraph'); }; elem.innerText = p_text; article_text.appendChild(elem); }); } }) } }); } let lay_paysocial = document.querySelector('div.lay-PaySocial'); removeDOMElement(lay_paysocial); } } else if (matchDomain('freiepresse.de')) { let url = window.location.href; let article_teaser = document.querySelector('div.article-teaser'); if (article_teaser && url.match(/(\-artikel)(\d){6,}/)) { window.setTimeout(function () { window.location.href = url.replace('-artikel', '-amp'); }, 500); // Delay (in milliseconds) } else if (url.match(/(\-amp)(\d){6,}/)) { let amp_ads = document.querySelectorAll('amp-fx-flying-carpet, amp-ad, amp-embed'); let pw_layer = document.querySelector('.pw-layer'); removeDOMElement(...amp_ads, pw_layer); } } else if (matchDomain('krautreporter.de')) { let paywall = document.querySelector('.article-paywall'); if (paywall) { let paywall_divider = document.querySelector('.js-paywall-divider'); let steady_checkout = document.querySelector('#steady-checkout'); removeDOMElement(paywall, paywall_divider, steady_checkout); let blurred = document.querySelectorAll('.blurred'); for (let elem of blurred) elem.classList.remove('blurred', 'json-ld-paywall-marker', 'hidden@print'); } } else if (matchDomain('kurier.at')) { let view_offer = document.querySelector('.view-offer'); removeDOMElement(view_offer); let plus_content = document.querySelector('.plusContent'); if (plus_content) plus_content.classList.remove('plusContent'); } else if (matchDomain(['noz.de', 'nwzonline.de', 'shz.de', 'svz.de'])) { let url = window.location.href; let paywall = document.querySelector('.paywall, .story--premium__container'); if (url.includes('?amp') || url.includes('-amp.html')) { let subscriber = document.querySelector('div[amp-access="NOT data.reduced"]'); if (subscriber) subscriber.removeAttribute('amp-access-hide'); let non_subscriber = document.querySelector('div[amp-access="data.reduced"]'); let amp_ads = document.querySelectorAll('amp-ad, amp-embed, #flying-carpet-wrapper'); removeDOMElement(non_subscriber, ...amp_ads); } else { let amphtml = document.querySelector('link[rel="amphtml"]'); if (paywall && amphtml) { removeDOMElement(paywall); window.location.href = amphtml.href; } } } else if (matchDomain('nzz.ch')) { let regwall = document.querySelector('.dynamic-regwall'); removeDOMElement(regwall); } else if (matchDomain('rheinpfalz.de')) { let url = window.location.href; if (url.includes('reduced=true')) { window.setTimeout(function () { window.location.href = url.split('?')[0]; }, 500); // Delay (in milliseconds) } } else if (matchDomain(['ruhrnachrichten.de', 'hellwegeranzeiger.de'])) { let paywall = document.querySelector('.PianoContent'); if (paywall) paywall.classList.remove('PianoContent'); } else if (matchDomain('sueddeutsche.de')) { let url = window.location.href; document.addEventListener('DOMContentLoaded', () => { let offer_page = document.querySelector('div.offer-page'); if (url.startsWith('https://www.sueddeutsche.de') && (url.includes('reduced=true') || offer_page)) window.location.href = url.split('?')[0].split('!')[0].replace('www.', 'amphtml.'); else if (url.startsWith('https://sz-magazin.sueddeutsche.de')) { if (url.includes('reduced=true') || offer_page) window.location.href = new URL(url).pathname + '!amp'; } }); window.setTimeout(function () { if (url.includes('!amp')) { let paragraph_reduced = document.querySelector('.paragraph--reduced'); if (paragraph_reduced) paragraph_reduced.classList.remove('paragraph--reduced'); let paragraph_hidden = document.querySelectorAll('.paragraph--hidden'); for (let par_hidden of paragraph_hidden) par_hidden.classList.remove('paragraph--hidden'); let paragraph_dynamic = document.querySelector('.paragraph--dynamic'); if (paragraph_dynamic) paragraph_dynamic.classList.remove('paragraph--dynamic'); let amp_offerpage = document.querySelector('.amp-offerpage'); removeDOMElement(amp_offerpage); } }, 500); // Delay (in milliseconds) } else if ((domain = matchDomain(de_madsack_domains)) || document.querySelector('link[rel="preload"][href="https://static.rndtech.de/cmp/1.x.x.js"]')) { let url = window.location.href; if (!url.includes(domain + '/amp/')) { let paidcontent_intro = document.querySelector('div.pdb-article-body-paidcontentintro'); if (paidcontent_intro) { paidcontent_intro.classList.remove('pdb-article-body-paidcontentintro'); let json_script = document.querySelector('div.pdb-article > script[type="application/ld+json"]'); let json_text = JSON.parse(json_script.text).articleBody; if (json_text) { let pdb_richtext_field = document.querySelectorAll('div.pdb-richtext-field'); if (pdb_richtext_field[1]) pdb_richtext_field[1].innerText = json_text; } let paidcontent_reg = document.querySelector('div.pdb-article-paidcontent-registration'); removeDOMElement(paidcontent_reg); } } else { let subscr_sections = document.querySelectorAll('section[subscriptions-section="content"]'); for (let subscr_section of subscr_sections) subscr_section.removeAttribute('subscriptions-section'); let amp_ads = document.querySelectorAll('.pdb-ad-container'); removeDOMElement(...amp_ads); } } else csDone = true; } else if (window.location.hostname.match(/\.(es|pt)$/) || matchDomain(['diariovasco.com', 'elconfidencial.com', 'elcorreo.com', 'elespanol.com', 'elpais.com', 'elperiodico.com', 'expansion.com', 'larioja.com', 'lavanguardia.com', 'levante-emv.com', 'politicaexterior.com'])) {//spain/portugal if (matchDomain('cmjornal.pt')) { let paywall = document.querySelector('.bloqueio_exclusivos'); let amphtml = document.querySelector('link[rel="amphtml"]'); let url = window.location.href; if (!url.includes('/amp/')) { if (paywall && amphtml) { removeDOMElement(paywall); window.location.href = amphtml.href; } } else { let section_hidden = document.querySelectorAll('section[amp-access="subscriber"]'); for (let elem of section_hidden) elem.removeAttribute('amp-access-hide'); let not_subscriber = document.querySelector('section[amp-access="NOT subscriber"]'); removeDOMElement(not_subscriber); let amp_ads = document.querySelectorAll('amp-ad, amp-embed, .detalheAds'); removeDOMElement(...amp_ads); let amp_links = document.querySelectorAll('a[href^="https://www-cmjornal-pt.cdn.ampproject.org/c/s/"]'); for (let amp_link of amp_links) amp_link.href = amp_link.href.replace('www-cmjornal-pt.cdn.ampproject.org/c/s/', ''); } } else if (matchDomain('elconfidencial.com')) { let premium = document.querySelector('div.newsType__content--closed'); if (premium) premium.classList.remove('newsType__content--closed'); } else if (matchDomain('elespanol.com')) { let adverts = document.querySelectorAll('[id*="superior"], [class*="adv"]'); removeDOMElement(...adverts); } else if (domain = matchDomain(['elmundo.es', 'expansion.com'])) { let premium = document.querySelector('.ue-c-article__premium'); let url = window.location.href; if (!url.includes('/amp.' + domain + '/')) { if (premium) { removeDOMElement(premium); window.location.href = window.location.href.replace('/www.', '/amp.'); } } else { let paywall = document.querySelector('div[amp-access="authorized!=true"]'); if (paywall) { removeDOMElement(paywall); let div_hidden = document.querySelector('div[amp-access="authorized=true"]'); if (div_hidden) { div_hidden.removeAttribute('amp-access-hide'); } } let adverts = document.querySelectorAll('.advertising, amp-embed'); removeDOMElement(...adverts); } } else if (matchDomain('elpais.com')) { let url = window.location.href; let login_register = document.querySelector('.login_register'); if (url.includes('.amp.html') || url.includes('?outputType=amp')) { let paywall = document.querySelectorAll('div[amp-access="success"]'); for (let elem of paywall) elem.removeAttribute('amp-access-hide'); let amp_ads = document.querySelectorAll('amp-ad'); removeDOMElement(login_register, ...amp_ads); } else { let amphtml = document.querySelector('link[rel="amphtml"]'); if (login_register && amphtml) { removeDOMElement(login_register); window.location.href = amphtml.href; } } let paywall_offer = document.querySelector('.paywallOffer'); removeDOMElement(paywall_offer); } else if (matchDomain('elperiodico.com')) { let url = window.location.href; if (!url.includes('amp.elperiodico.com')) { let div_hidden = document.querySelector('div.closed'); if (div_hidden) div_hidden.classList.remove('closed'); else { let paywall = document.querySelector('.ep-masPeriodico-info-login'); removeDOMElement(paywall); if (paywall) window.location.href = url.replace('www.', 'amp.'); } } else { let not_logged = document.querySelector('.ep-masPeriodico-info-login'); if (not_logged) { let non_subscr_section = document.querySelector('div[amp-access="NOT logged"]'); removeDOMElement(not_logged, non_subscr_section); let subscr_section = document.querySelector('div[amp-access="logged"]'); if (subscr_section) subscr_section.removeAttribute('amp-access-hide'); } window.setTimeout(function () { let amp_img = document.querySelectorAll('amp-img > img'); for (let elem of amp_img) { if (elem.src) elem.src = elem.src.replace('amp.elperiodico.com/clip/', 'estaticos-cdn.elperiodico.com/clip/'); } }, 3000); // Delay (in milliseconds) } } else if (matchDomain(es_grupo_vocento_domains)) { let url = window.location.href; let content_exclusive_bg = document.querySelector('.content-exclusive-bg, #cierre_suscripcion'); let amphtml = document.querySelector('link[rel="amphtml"]'); if (content_exclusive_bg && amphtml) { removeDOMElement(content_exclusive_bg); window.location.href = url.replace('.html', '_amp.html'); } else if (url.includes('_amp.html')) { let voc_advers = document.querySelectorAll('.voc-adver, amp-embed'); removeDOMElement(...voc_advers); let container_wall_exclusive = document.querySelector('.container-wall-exclusive'); if (container_wall_exclusive) { let non_subscr_section = document.querySelector('[amp-access="result!=\'ALLOW_ACCESS\'"]'); removeDOMElement(container_wall_exclusive, non_subscr_section); let subscr_section = document.querySelectorAll('[amp-access="result=\'ALLOW_ACCESS\'"][amp-access-hide]'); for (let elem of subscr_section) elem.removeAttribute('amp-access-hide'); } //lavozdigital.es let paywall = document.querySelector('span[subscriptions-section="content"]'); if (paywall) { paywall.classList.remove('paywall'); paywall.removeAttribute('subscriptions-section'); } } } else if (matchDomain(es_epiberica_domains)) { let truncated = document.querySelector('div.article-body--truncated'); if (truncated) truncated.classList.remove('article-body--truncated'); window.setTimeout(function () { let paywall = document.querySelector('div.paywall'); removeDOMElement(paywall); }, 500); // Delay (in milliseconds) if (window.location.href.includes('.amp.html')) { let div_access = document.querySelector('div[amp-access="access"]'); removeDOMElement(div_access); let div_hidden = document.querySelectorAll('div[amp-access="NOT access"][amp-access-hide], div[amp-access="FALSE"][amp-access-hide]'); for (let elem of div_hidden) elem.removeAttribute('amp-access-hide'); } else { let div_hidden = document.querySelector('div.baldomero'); if (div_hidden) div_hidden.classList.remove('baldomero'); } } else if (matchDomain('lavanguardia.com')) { let paywall = document.querySelector('[class*="ev-open-modal-paywall"]'); let infinite_loading = document.querySelector('#infinite-loading'); removeDOMElement(paywall, infinite_loading); } else if (matchDomain('observador.pt')) { let paywall = document.querySelector('.premium-article'); if (paywall) paywall.classList.remove('premium-article'); } else if (matchDomain('politicaexterior.com')) { let paywall = document.querySelector('div[class^="paywall-"]'); if (paywall) { let article = document.querySelector('div.entry-content-text'); let json = document.querySelector('script[type="application/ld+json"]:not([class]'); if (json) { var json_text = JSON.parse(json.text).description.replace(/ /g, ''); let article_new = document.createElement('div'); article_new.setAttribute('class', 'entry-content-text'); article_new.innerText = '\r\n' + json_text; article.parentNode.replaceChild(article_new, article); } removeDOMElement(paywall); } } else csDone = true; } else if (window.location.hostname.endsWith('.fr') || matchDomain(['bienpublic.com', 'journaldunet.com', 'la-croix.com', 'ledauphine.com', 'ledevoir.com', 'lejsl.com', 'loeildelaphotographie.com', 'nouvelobs.com', 'parismatch.com'])) {//france if (matchDomain('alternatives-economiques.fr')) { window.setTimeout(function () { let paywall = document.querySelector('#temp-paywall'); removeDOMElement(paywall); let data_ae_poool = document.querySelector('div[data-ae-poool]'); if (data_ae_poool) data_ae_poool.removeAttribute('style'); }, 500); // Delay (in milliseconds) } else if (matchDomain('atlantico.fr')) { let paywall = document.querySelector('div.markup[class*="Paywall"]'); if (paywall) paywall.setAttribute('class', 'markup'); } else if (matchDomain('challenges.fr')) { let amorce = document.querySelector('.user-paying-amorce'); if (amorce) amorce.setAttribute('style', 'display:none !important'); let content = document.querySelector('.user-paying-content'); if (content) content.setAttribute('style', 'display: block !important'); let paywall = document.querySelector('.temp-paywall'); removeDOMElement(paywall); } else if (matchDomain('charliehebdo.fr')) { window.setTimeout(function () { let paywalled_content = document.querySelector('div.ch-paywalled-content'); if (paywalled_content) paywalled_content.removeAttribute('style'); let poool_widget = document.querySelector('div#poool-widget'); removeDOMElement(poool_widget); }, 500); // Delay (in milliseconds) } else if (matchDomain('esprit.presse.fr')) { let paywall = document.querySelector('.panel-popup-paywall'); removeDOMElement(paywall); } else if ((domain = matchDomain(fr_groupe_ebra_domains)) && window.location.href.match(/\/\d{4}\/\d{2}\/\d{2}\//)) { let url = window.location.href; let url_new = url.replace(domain + '/', domain + '/amp/'); if (!url.includes(domain + '/amp/')) { let free = document.querySelector('[class^="paywall"]'); if (!free) { window.setTimeout(function () { window.location.href = url_new; }, 500); // Delay (in milliseconds) } } else { let amp_access_hide = document.querySelector('[amp-access-hide]'); if (amp_access_hide) { let not_access_section = document.querySelector('section[amp-access="NOT access"]'); removeDOMElement(not_access_section); amp_access_hide.removeAttribute('amp-access-hide'); } let amp_ads = document.querySelectorAll('amp-ad'); removeDOMElement(...amp_ads); } } else if (domain = matchDomain(fr_groupe_la_depeche_domains)) { let url = window.location.href; let url_new = url.replace(domain + '/', domain + '/amp/'); if (url.includes(domain + '/amp/')) { let subscr_section = document.querySelectorAll('[subscriptions-section="content"]'); for (let elem of subscr_section) elem.removeAttribute('subscriptions-section'); let amp_ads = document.querySelectorAll('amp-ad, amp-embed'); removeDOMElement(...amp_ads); } else { let paywall = document.querySelector('div.paywall'); if (paywall) { removeDOMElement(paywall); window.location.href = url_new; } } } else if (matchDomain('journaldunet.com')) { let reg_wall = document.querySelector('.reg_wall'); removeDOMElement(reg_wall); let entry_reg_wall = document.querySelector('.entry_reg_wall'); if (entry_reg_wall) { entry_reg_wall.removeAttribute('style'); } } else if (matchDomain('la-croix.com')) { let url = window.location.href; if (!url.includes('la-croix.com/amp/')) { let paywall_host_param = document.querySelector('#paywall-host-param'); removeDOMElement(paywall_host_param); let show_paywall = document.querySelector('#showPayWall'); if (show_paywall) window.setTimeout(function () { window.location.reload(true); }, 500); } else { let paywall_block = document.querySelector('#paywall_block'); let amp_ads = document.querySelectorAll('amp-ad, amp-embed'); removeDOMElement(paywall_block, ...amp_ads); } } else if (matchDomain('lanouvellerepublique.fr')) { let alert_didacticiel = document.querySelector('div.alert-didacticiel'); let loading = document.querySelectorAll('span.loading'); removeDOMElement(alert_didacticiel, ...loading); } else if (matchDomain('ledevoir.com')) { let counter = document.querySelector('.popup-msg'); removeDOMElement(counter); } else if (matchDomain(['lejdd.fr', 'parismatch.com'])) { let poool_banner = document.querySelector('#poool-container'); let forbidden = document.querySelector('.forbidden'); removeDOMElement(poool_banner, forbidden); let bottom_hide = document.querySelector('.cnt[data-poool-mode="hide"]'); if (bottom_hide) { bottom_hide.removeAttribute('data-poool-mode'); bottom_hide.removeAttribute('style'); } } else if (matchDomain('lesechos.fr') && window.location.href.match(/-\d{6,}/)) { window.setTimeout(function () { let abo_banner = document.querySelector('[class^="pgxf3b"]'); let ad_blocks = document.querySelectorAll('[class*="jzxvkd"'); for (let ad_block of ad_blocks) ad_block.setAttribute('style', 'display:none'); if (abo_banner) { removeDOMElement(abo_banner); let url = window.location.href; let html = document.documentElement.outerHTML; let state; let split1 = html.split('window.__PRELOADED_STATE__=')[1]; let split2 = split1.split('')[0].trim(); if (split2.includes('; window.__DATA__=')) state = split2.split('; window.__DATA__=')[0].trim(); else state = split2.substr(0, split2.length - 1); try { let data = JSON.parse(state); let article = data.article.data.stripes[0].mainContent[0].data.description; let url_loaded = data.article.data.path; if (!url.replace(/%20/g, '').includes(url_loaded)) window.location.reload(true); let paywallNode = document.querySelector('.post-paywall'); if (paywallNode) { let contentNode = document.createElement('div'); let parser = new DOMParser(); let article_html = parser.parseFromString('
' + DOMPurify.sanitize(par_key) + '
', 'text/html'); par_elem = par_html.querySelector('p'); } else par_elem.innerText = par_key; if (key === 'subhead') par_elem.setAttribute('style', 'font-weight: bold;'); } else if (key === 'image') { par_elem = document.createElement('img'); par_elem.src = par_key.url; } else if (key === 'bullet_list') { par_elem = document.createElement('ul'); for (let bullet of par_key) { par_html = parser.parseFromString('' + DOMPurify.sanitize(par_key) + '
', 'text/html'); par_elem = par_html.querySelector('p'); } if (!['streamone', 'legacy-ml'].includes(key)) par_elem.setAttribute('style', 'font-size: 16px;'); div_content.appendChild(par_elem); } } } } }); window.setTimeout(function () { let overlay = document.querySelector('div.cj-root'); removeDOMElement(overlay); let noscroll = document.querySelector('html.is-dialog-active'); if (noscroll) noscroll.classList.remove('is-dialog-active'); }, 500); // Delay (in milliseconds) } else if (matchDomain('knack.be')) { let paywall = document.querySelector('.rmgPaywall'); if (paywall) { removeDOMElement(paywall); let hidden_body = document.querySelector('div.rmgDetail-body div'); if (hidden_body) { hidden_body.removeAttribute('class'); let body_text = hidden_body.innerText.replace(/(?:^|[\w\"\'])(\.|\?|!)(?=[A-Za-zÀ-ÿ\"\']{2,})/gm, "$&\n\n"); hidden_body.innerText = body_text; let intro_par = document.querySelector('div.rmgDetail-body p'); if (intro_par && intro_par.innerText.length > 200) removeDOMElement(intro_par); } } } else if (matchDomain(["lc.nl", "dvhn.nl"])) { document.addEventListener('DOMContentLoaded', () => { if (window.location.href.includes('?')) window.location.href = window.location.href.split('?')[0]; }); let top_ad = document.querySelector('.top__ad'); let plus = document.querySelector('.plusJustRead'); removeDOMElement(top_ad, plus); } else if (matchDomain(nl_mediahuis_region_domains)) { window.setTimeout(function () { let close_button = document.querySelector('button[data-testid="button-close"]'); if (close_button) close_button.click(); let premium = document.querySelector('div.common-components-plus_pluslabel--container'); if (premium) { let hidden_article = document.querySelector('div[data-auth-body="article"]'); if (hidden_article) hidden_article.removeAttribute('style'); let paywall = document.querySelector('div[data-auth-root="paywall"]'); removeDOMElement(paywall); let auth_body = document.querySelector('div[data-auth-body="article"]'); if (paywall && auth_body) { let auth_body_par_count = auth_body.querySelectorAll('p'); if (auth_body_par_count.length < 2) { let url = window.location.href; let html = document.documentElement.outerHTML; let split1 = html.split('window["__PRELOADED_STATE_GRAPH__')[1].split(/=(.+)/)[1]; let split2 = split1.split('')[0].trim(); let split3 = split2.split('"body":')[1]; let state = split3.split('},"gal')[0] + '}'; try { let data = JSON.parse(state); let article = data.json; auth_body.innerHTML = ''; let par_html, par_dom, par_elem, par_div, par_key; let parser = new DOMParser(); for (let par of article) { for (let key in par) { par_dom = document.createElement('p'); par_elem = ''; par_key = par[key]; if (key === 'subhead') { par_html = parser.parseFromString('