commit 52566961d6090cbaa0476e8a6a6f0ab8edfb8fa6 Author: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Sat Aug 10 08:46:14 2024 +0200 Release latest diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ab20918 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020, magnolia1234 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..b013346 --- /dev/null +++ b/README.md @@ -0,0 +1,53 @@ +# Bypass Paywalls Clean filters + +Adblocker list which allows you to read articles from (supported) sites that implement a paywall (for a lot of sites you also need to install an userscript).\ +For some sites it will log you out (or block you to log in); caused by removing cookies or blocking general paywall-scripts. + +Disclaimer: the list doesn't support as many sites as the extension/add-on does though (and even less on iOS).\ +On iOS you can also use [Shortcuts](https://apps.apple.com/app/shortcuts/id915249334) app with [Unpaywall](https://www.icloud.com/shortcuts/71648f5ad34f4d8f972718e5f3621ffe) shortcut for some unsupported sites. + +### Installation + +#### adblocker filters + +Use a browser which supports extensions/add-ons and install an adblocker (like uBlock Origin or AdGuard).\ +Now add custom (content)filter (copy link): +[Bypass Paywalls Clean filters](https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters/blob/raw?file=bpc-paywall-filter.txt)\ +Or subscribe: +[subscribe on filterlists.com](https://filterlists.com/lists/bypass-paywalls-clean-filter) - +[subscribe for AdGuard](https://subscribe.adblockplus.org/?location=https%3A%2F%2Fgitflic.ru%2Fproject%2Fmagnolia1234%2Fbypass-paywalls-clean-filters%2Fblob%2Fraw%3Ffile%3Dbpc-paywall-filter.txt&title=Bypass%20Paywalls%20Clean%20filters) + +Brave browser has only incorporated the filterlist (many sites also need userscript): enable it in [settings](brave://adblock)\ +On Android you can use [Via Browser](https://play.google.com/store/apps/details?id=mark.via.gp) which supports custom filterlists & userscripts. + +You can also install an app like AdGuard* (on Android & iOS/macOS) or [AdLock](https://apps.apple.com/app/adlock-ads-blocker-privacy/id1506604517) (on iOS).\ +This way you can use it with Chrome/Firefox (on Android) or Safari (on iOS/macOS). + +\* [AdGuard Content Blocker](https://play.google.com/store/apps/details?id=com.adguard.android.contentblocker) (on Android) only works with Yandex Browser or Samsung Internet Browser when you add the filter (url) to user rules (manual update of filter required).\ +Or use [AdGuard app](https://adguard.com/adguard-android/overview.html) (from their site) which works for all apps (and automatically updates filter). + +An external app may work less effective (timing/refresh issues).\ +On iOS there may be no support for scriptlets (for removing cookies, attributes and/or classes), but works with for example AdGuard Premium (paid feature). + +#### userscripts + +Some fixes also require an app to run an additional userscript to work.\ +For example amp-redirect (also disable amp-to-html extension for these sites), unhide text/images and more. + +Example apps or extensions/add-ons you can use: + +* Android: [AdGuard app](https://adguard.com/adguard-android/overview.html) (load userscript as extension) +* iOS: [wBlock](https://apps.apple.com/app/wblock/id6746388723) or [Tampermonkey (paid)](https://apps.apple.com/app/tampermonkey/id6738342400) +* macOS: [AdGuard app](https://adguard.com/en/adguard-mac/overview.html) +* Windows/ChromeOS: Tampermonkey [Chrome extension](https://chromewebstore.google.com/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo) or [Firefox add-on](https://addons.mozilla.org/firefox/addon/tampermonkey) + +Userscripts for different languages: + +[English (& other)](https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters/blob/raw?file=userscript/bpc.en.user.js) - +[Dutch](https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters/blob/raw?file=userscript/bpc.nl.user.js) - +[Finnish/Swedish/Danish](https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters/blob/raw?file=userscript/bpc.fi.se.user.js) - +[French](https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters/blob/raw?file=userscript/bpc.fr.user.js) - +[German](https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters/blob/raw?file=userscript/bpc.de.user.js) - +[Italian](https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters/blob/raw?file=userscript/bpc.it.user.js) - +[Polish](https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters/blob/raw?file=userscript/bpc.pl.user.js) - +[Spanish/Portugese](https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters/blob/raw?file=userscript/bpc.es.pt.user.js) diff --git a/bpc-paywall-filter.txt b/bpc-paywall-filter.txt new file mode 100644 index 0000000..a298b03 --- /dev/null +++ b/bpc-paywall-filter.txt @@ -0,0 +1,837 @@ +! Title: Bypass Paywalls Clean filter +! Expires: 1 day (update frequency) +! Description: Filters for news sites (supports less sites than the extension/add-on) +! Homepage: https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters +! License: MIT; https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters/blob/raw?file=LICENSE +! Last modified: +! Version: 4.2.4.5 + +! General + +||amplitude.com^$xmlhttprequest,third-party +||axate.io$script,third-party +||loader.*.com/prod/*/loader.min.js$script +||cdn.*.com/prod/*/loader.min.js$script +||blueconic.net^$third-party +/[a-z]{1}\d{2,3}\.\w+\.(co(m|\.uk)|net|org)\/script\.js/$script,~third-party +||cxense.com^$script,third-party,domain=~journaldemontreal.com|~journaldequebec.com|~wsj.com +||cxense.com^$script,domain=bizjournals.com,important +||ensighten.com/*/Bootstrap.js$script,third-party +||evolok.net^$third-party +||fewcents.co/*/paywall*.js$script,third-party +||hadrianpaywall.com^$third-party +.de/sub/js/pc-offer-west.js$script,~third-party +||js.matheranalytics.com^$script,third-party +||newsmemory.com?meter$third-party +||olytics.omeda.com^$third-party +||onecount.net^$third-party +||js.pelcro.com^$script,third-party +/xbuilder/experience/execute$xmlhttprequest,~third-party,domain=~fortune.com +||piano.io/xbuilder/experience/execute$xmlhttprequest,third-party,domain=~automobilwoche.de +@@||piano.io^$domain=hbr.org|japantimes.co.jp +@@||tinypass.com$script,domain=ajc.com|thelogic.co +||api.pico.tools/client/query/*$xmlhttprequest,~third-party +||api.pico.tools/popup/null/*$xmlhttprequest,~third-party +gadget.pico.tools##+js(json-prune, locked) +||poool.fr^$third-party +||qiota.com^$xmlhttprequest,third-party +||sophi.io^$third-party +||steadyhq.com^$script,third-party +||wallkit.net/js/$script,third-party +||zephr.com/zephr-browser/$script,third-party +/arc/subs/p.min.js$script,~third-party +/c/assets/pigeon.js$script,~third-party +/evolok/*ev-em.min.js$script,domain=~vikatan.com +/evolok/*ev-widgets.min.js$script +/paywall/evercookie_get.js$script,~third-party +/shared-content/art/tncms/api/access.*.js$script,~third-party +/wp-content/plugins/leaky-paywall/js/leaky-paywall-cookie.js$script,~third-party +/wp-content/plugins/newspack-plugin/dist/memberships-gate-metering.js$script,~third-party +/wp-content/*/plugins/rcp-view-limit/$script,~third-party +/zephr/feature$xmlhttprequest + +||abril.com.br/*/abril-paywall/$script,~third-party +adweek.com##+js(cookie-remover, blaize_session) +||adweek.com/wp-content/plugins/adw-zephr/$script,~third-party +ajc.com##+js(ra, class, div.story-paygate_placeholder, stay) +ajc.com##div.video-blocker +ajc.com##+js(set, window.Fusion.globalContent._id, 0) +ajc.com##+js(set, window.Fusion.globalContent.content_restrictions.content_code, 0) +alternatives-economiques.fr###temp-paywall +alternatives-economiques.fr##+js(ra, style, div[data-ae-poool], stay) +ambito.com##+js(cookie-remover, TDNotesRead) +||americanaffairsjournal.org/wp-content/mu-plugins/app/src/paywall/paywall.js$script,~third-party +apollo-magazine.com##+js(cookie-remover, blaize_session) +apollo-magazine.com,spectator.co.uk###subscribe-ribbon,div.ad-slot +artforum.com##+js(cookie-remover, /^/) +||artnet.com/paywall-ajax.php$xmlhttprequest,~third-party +artnet.com##div.article-body:style(display:block !important;) +artnet.com##div[id^="issuem-leaky-paywall-"] +asia.nikkei.com##div.tp-modal,div.tp-backdrop +asia.nikkei.com##+js(rc, tp-modal-open, body.tp-modal-open, stay) +magazine.atavist.com##+js(set-local-storage-item, /^/, $remove$) +||tonos.gjirafa.tech/init/access$xmlhttprequest,domain=atlantico.fr +automobilwoche.de##+js(set, window.Fusion.globalContent._id, 0) +automobilwoche.de##+js(set, window.Fusion.globalContent.content_restrictions, {}) +axios.com##div[data-cy="pro-paywall"],div[class^="Modal_paywall"],div[class^="Modal_cta"] +axios.com##+js(ra, style, html[style], stay) +bhaskar.com##div.paywallBlockedContent~div:remove() +bhaskar.com##article div:empty +bhaskar.com##+js(ra, class, div.paywallBlockedContent, stay) +/\.bizjournals\.com\/.+\/(news|stories)\/.+\.html/$inline-script +bizjournals.com##div[id^="headlessui-dialog-"],div.sheet-overlay +! bloomberg.com: disable Dark Reader extension +||cm.bloomberg.com^$xmlhttprequest,~third-party +||assets.bwbx.io/s3/javelin/public/javelin/js/foundation/transporter/foundation_transporter-*.js$script,domain=bloomberg.com +bloomberg.com##+js(ra, data-paywall-overlay-status, body[data-paywall-overlay-status], stay) +bloomberg.com##div[id^="fortress-"] +bloomberg.com##+js(set-local-storage-item, history, $remove$) +||bloombergadria.com/*/news$inline-script +bloombergadria.com##+js(ra, style, article.single-news[style], stay) +||meter.bostonglobe.com/js/meter.js$script,~third-party +/\.businessinsider\.com\/chunks\/scripts\/\d.+\.js/$script,domain=businessinsider.com,~third-party +businessinsider.jp##+js(ra, hidden, div.piano-paywall-container[hidden]) +||businessoffashion.com/arc-platform-proxy.js$script,~third-party +||businesspost.ie/api/tinypass.min.js$script,~third-party +capital.fr##+js(ra, class|hidden, div#articleWall-paid, stay) +capital.fr##div#articleWall-paid:style(margin-top: 40px !important;) +capital.fr##+js(ra, class, div#articleWall, stay) +capital.fr##div#articleWall-wrapper +cartacapital.com.br##+js(rc, contentSoft, div.contentSoft) +cartacapital.com.br##div[class^="s-freemium"],div.maggazine-add +cen.acs.org##+js(cookie-remover, cenLoginP) +cen.acs.org##.meteredBar +challenges.fr##div.amorce.manual +challenges.fr##+js(ra, class|hidden, .user-paying-content) +||cdn.piano.io/api/tinypass.min.js$script,domain=clicrbs.com.br +||clicrbs.com.br/paywall-api/count/$xmlhttprequest,~third-party +cnbc.com##div.ArticleGate-proGate +cnbc.com##+js(ra, class|hidden, span[hidden]) +cnn.com##div[data-component-id="subwall"] +cnn.com##+js(ra, style, html[style], stay) +cnn.com##+js(ra, style, body[style], stay) +cnn.com##+js(set-local-storage-item, /reg_?wall/i, $remove$) +columbian.com##+js(cookie-remover, blaize_session) +columbian.com##div.modal,div#onesignal-slidedown-container +chronicle.com,philanthropy.com##div[data-content-summary] +chronicle.com,philanthropy.com##+js(ra, hidden|ppajfrg86rdhoubtirllb2bf1xsaknzus, div[class~="contentBody" i][hidden], stay) +citywire.com##+js(rc, article-locked, .article-locked) +citywire.com##+js(rc, m-article--locked, .m-article--locked) +citywire.com##+js(rc, m-media-container--locked, .m-media-container--locked) +citywire.com##+js(rc, m-article__body--locked, .m-article__body--locked) +citywire.com##registration-widget,div.alert--locked +||zonda.clarin.com^$script,domain=clarin.com|lavoz.com.ar|ole.com.ar +||commentary.org/*/js/dg-locker-public.js$script,~third-party +||connaissancedesarts.com/wp-content/*/vendor/iptools-jquery-inview.min.js$script,~third-party +||paywall.correiodopovo.com.br$script,~third-party +||corriereobjects.it/*/js/_paywall.sjs$script,domain=corriere.it +cronista.com##+js(rc, article-body--blurred, div.article-body--blurred, stay) +cronista.com##div.paywall-chain--show +csmonitor.com##+js(set-local-storage-item, /^/, $remove$) +csmonitor.com##.paywall +cyclingnews.com##+js(rc, paywall-locker, div.paywall-locker) +dailywire.com###post-body-text > div > div:style(height: auto !important;) +||denik.cz/*.html$inline-script +discovermagazine.com##body:style(overflow: auto !important;) +discovermagazine.com##div.fIkXwQ,div[style*="fadeIn"],div[role="button"][aria-label="Dismiss Dialog"] +||dn.se/check-paywall-v2.js,~third-party +||dwell.com/article/*?rel=plus$inline-script +eastwest.eu##+js(ra, style, .paywall) +eastwest.eu##+js(rc, paywall, .paywall) +eastwest.eu###testo_articolo > p, #testo_articolo > h3 +eastwest.eu##.offerta_abbonamenti +||economist.com/latest/wall-ui.js$script,~third-party +||editorialedomani.it/pelcro.js$script,~third-party +elespanol.com##+js(rc, content-not-granted-paywall, div.content-not-granted-paywall) +elespanol.com##div.full-suscriptor-container +elconfidencial.com##+js(rc, newsType__content--closed, div.newsType__content--closed) +||elobservador.com.uy/shares$xmlhttprequest,~third-party +||elpais.com.uy/user/authStatus$script,~third-party +||prisa.com/dist/subs/pmwall/*/pmwall.min.js$script,domain=elpais.com +||verne.elpais.com/*.html$inline-script +eltiempo.com##+js(rc, modulos, div.modulos) +||eltribuno.com/scripts/Bellhop/dist/bellhop.min.js$script,~third-party +em.com.br##+js(rc, compress-text, .div.compress-text) +enotes.com##section#enotes-paywall +enotes.com##+js(ra, class, div.u-paywall) +||estadao.com.br/paywall/$script,~third-party +||estadao.com.br/access.js$script,~third-party +etc.se##+js(rc, teaser-section, section.teaser-section) +etc.se##+js(rc, hidden, section.prose-feature .hidden) +etc.se##article section.font-sans +euobserver.com##+js(rc, show, div.membership-upsell.show) +||exame.com/_next/static/chunks/app/%5B*.js$script,~third-party +fieldandstream.com##div[class^="mailmunch-"] +fieldandstream.com##+js(ra, class, html[class]) +||financialexpress.com/*/min/premiumStoryContent.js$script,~third-party +financialexpress.com##+js(rc, paywall, .paywall) +financialexpress.com##div.pcl-wrap +||folha.uol.com.br/paywall/js/$script,~third-party +||paywall.folha.uol.com.br^$script,xmlhttprequest,~third-party +forbes.com##+js(ra, class, html[class], stay) +forbes.com##+js(ra, class, body[class], stay) +forbes.com.au##+js(cookie-remover, blaize_session) +||foreignaffairs.com/modules/custom/fa_paywall_js/js/paywall.js$script,~third-party +||foreignaffairs.com/sites/default/files/assets/css/css_*.css*delta=0$stylesheet,~third-party +foreignaffairs.com##.article-dropcap:style(height: auto !important;) +foreignaffairs.com##.paywall,.loading-indicator,.messages--container--bottom +foreignpolicy.com##body:not(.is-fp-insider) div.content-ungated +foreignpolicy.com##+js(rc, content-gated, body:not(.is-fp-insider) div.content-gated.content-gated--main-article) +fortune.com##+js(ra, class, div.paywallActive) +fortune.com##+js(cookie-remover, xbc) +fortune.com##+js(cookie-remover, pcid) +fortune.com##div.tp-container-inner +foxnews.com##+js(ra, class, div[class*="gated-overlay"]) +foxnews.com##div.article-gating-wrapper +||ftm.eu/js/routing$script,~third-party +||ftm.nl/js/routing$script,~third-party +ftm.eu,ftm.nl##+js(rc, foldable, div.foldable) +ftm.eu,ftm.nl##div.banner-pp +gauchazh.clicrbs.com.br##+js(ra, class, div.m-paid-content>div.hidden, stay) +groene.nl##+js(cookie-remover, rlist) +harpers.org##+js(cookie-remover, hr_session) +||harpers.org/wp-content/themes/timber/static/js/modal*.js +||cdn.tinypass.com/api/tinypass.min.js$script,domain=hbr.org +||hilltimes.com/*/js/loadingoverlay/loadingoverlay.min.js$script,~third-party +hindustantimes.com##div[class^="sub-paywall-version"],.closeStory +hindustantimes.com##+js(rc, freemiumText, .freemiumText) +hindustantimes.com##+js(rc, open-popup, body.open-popup) +ilfattoquotidiano.it##+js(rc, cropped, article[id].cropped) +ilfattoquotidiano.it##div#ifq-paywall-metered +ilsole24ore.com##+js(ra, style, body[style], stay) +ilsole24ore.com##div.s24_adb +||inc42.com/wp-admin/admin-ajax.php|$xmlhttprequest,~third-party +indianexpress.com##+js(ra, style, div.ev-meter-content[style]) +indianexpress.com##+js(ra, class, p.first_intro_para) +indianexpress.com##ev-engagement +||liveapp.inews.co.uk/*/content.html$inline-script +inkl.com##+js(ra, class, div.paywall) +inkl.com##div.gradient-container +interestingengineering.com##body:style(overflow: auto !important; position: relative !important; top: unset !important) +interestingengineering.com##main>div[class*="t-hidden"],div.t-bg-black +irishexaminer.com/##+js(cookie-remover, blaize_session) +japantimes.co.jp##+js(cookie-remover, xbc) +journaldemontreal.com,journaldequebec.com##+js(rc, composer-content, div.article-main-txt.composer-content) +journaldunet.com##div.reg_wall +journaldunet.com##+js(ra, style, div.entry_reg_wall[style]) +||jpost.com/js/js_article.min.js$script,~third-party +||internazionale.it/templates_js_ajax.inc.php$xmlhttprequest,~third-party +krautreporter.de##section.js-access-wall,div.js-paywall-divider,#steady-checkout +krautreporter.de##+js(rc, blurred, .blurred, stay) +krautreporter.de##+js(rc, json-ld-paywall-marker, .json-ld-paywall-marker, stay) +ksta.de,rundschau-online.de##+js(cookie-remover, anon_cookie) +ksta.de,rundschau-online.de##+js(ra, style, div[data-article-content], stay) +ksta.de,rundschau-online.de##div.dm-paywall-wrapper,div.dm-slot,div.dm-zephr-banner +||cdn.tinypass.com/api/tinypass.min.js$script,domain=kurier.at +kurier.at##+js(ra, class|style, div.paywall) +kurier.at##div#cfs-paywall-container +||glanacion.com/*/metering/*.js$script,domain=lanacion.com.ar +lanacion.com.ar##+js(cookie-remover, /^metering_arc/) +lanacion.com.ar##+js(set-local-storage-item, /^/, $remove$) +||latimes.com/meteringjs/$script,~third-party +||ev.lavanguardia.com$xmlhttprequest,~third-party +lavanguardia.com,mundodeportivo.com##span.content-ad,span.hidden-ad,span.ad-unit,div.ad-div +ledevoir.com##+js(cookie-remover, pw6) +legrandcontinent.eu##+js(rc, paywall|pw|softwall, body) +lejdd.fr,parismatch.com,public.fr###poool-container,#poool-widget-content,#poool-widget,.forbidden +lejdd.fr,parismatch.com,public.fr##+js(ra, data-poool-mode, .cnt[data-poool-mode="hide"]) +||livemint.com/lm-img/subscription/$script,~third-party +livemint.com##+js(rc, paywall, div.paywall) +livemint.com##div[class^="storyPaywall_paywallStory_"]:remove() +labusinessjournal.com##+js(cookie-remover, /^/) +labusinessjournal.com###css-only-modals +/\.emol\.cl\/(.+\/)?(pram-modal|PramModal)\.min\.js/$script,domain=lasegunda.com +||lavoz.com.ar/sites/*/paywall/*/pw.js$script,third-party +letelegramme.fr##+js(rc, tlg-paywalled, div.tlg-paywalled) +loebclassics.com##+js(cookie-remover, hupLclFreeReadsCookie) +||cdn.loeildelaphotographie.com/wp-content/*/hague-child/js/script-$script,~third-party +loeildelaphotographie.com##+js(ra, class, .paywall) +loeildelaphotographie.com##.premium-pic-box,.membership-promo-container,.login_form_litle +loeildelaphotographie.com##+js(ra, style, img[style*="blur"]) +||lrb.co.uk$inline-script +marketwatch.com##+js(cookie-remover, cX_P) +||medscapestatic.com/*/medscape-library.js$script,domain=medscape.com +||wbmdstatic.com/*/chunk-vendors.*.js$script,domain=medscape.com +medscape.com##.AdUnit,div[id^="ads-"] +mexiconewsdaily.com##+js(rc, tdb-block-inner, body.single div.td-post-content > div.tdb-block-inner) +||motorsportmagazine.com/wp-admin/admin-ajax.php$xmlhttprequest,~third-party +||ev.mundodeportivo.com$xmlhttprequest,~third-party +mv-voice.com##+js(cookie-remover, /^/) +||cdn.registerdisney.go.com$script,domain=nationalgeographic.com +||nautil.us/wp-content/themes/*/js/js.cookie.min.js$script,~third-party +||loader.newsday.com$script,~third-party +newsday.com##+js(ra, class, html[class]) +newrepublic.com##div.article-scheduled-modal +||blink.net/*/blink-sdk.js$script,domain=newrepublic.com|thebaffler.com +||townnews.com/*/tncms/*/scripts/engage.min.js$script,third-party,domain=nola.com|shreveportbossieradvocate.com|theadvocate.com +nrc.nl##+js(cookie-remover, counter) +||nrc.nl/paywall-api/api/zephr$xmlhttprequest,~third-party +nrc.nl##div[id$="modal__overlay"],div.header__subscribe-bar,div.banner +||nsctotal.com.br/wp-content/themes/nsctotal/js/paywall.min.js$script,~third-party +||nybooks.com/wp-admin/admin-ajax.php$xmlhttprequest,~third-party +nybooks.com##+js(rc, paywall-article, .paywall-article) +nybooks.com##div.toast-cta +||nysun.com/api/zephr/$xmlhttprequest,~third-party +||meter-svc.nytimes.com/meter.js$xmlhttprequest,~third-party +||nytimes.com/svc/onsite-messaging/query$xmlhttprequest,~third-party +||mwcm.nyt.com/$script,domain=nytimes.com +nytimes.com##div[data-testid="inline-message"],div[id^="ad-"],div#dock-container,div.pz-ad-box +||cooking.nytimes.com/api/*/access$xmlhttprequest,~third-party +||nzherald.co.nz/zephr/$xmlhttprequest,~third-party +nzherald.co.nz##+js(set, window.Fusion.globalContent.isPremium, false) +nzz.ch,themarket.ch##+js(rc, nzzinteraction, .nzzinteraction, stay) +nzz.ch##+js(ra, class, div.barrier, stay) +||cdn.piano.io/api/tinypass.min.js$script,domain=nzz.ch|themarket.ch +||tms.danzz.ch/scripts/t.min.js$script,domain=nzz.ch|themarket.ch +||observador.pt/wp-content/*/paywall-price-*.js$script,~third-party +paloaltoonline.com##+js(cookie-remover, /^/) +||pastemagazine.com/wp-content/cache/autoptimize/js/autoptimize_*.js$script,~third-party +pb.pl##+js(ra, class, section.o-article-content, stay) +pb.pl##div.o-piano-template-loader-box +pourleco.com##+js(ra, style, div[class*="article-"][style]) +pourleco.com##div[data-pleco-poool^="paywall"],div[data-pleco-transition="fade"] +philosophynow.org##+js(cookie-remover, /^/) +profil.at##+js(ra, class|style, div.paywall) +profil.at##div#cfs-paywall-container,div.consentOverlay +||kinja-static.com/assets/*/regwalled-content.*.js$script,domain=qz.com +||reviewjournal.com/wp-content/plugins/*/loader_prod.min.js$script,~third-party +||revistaoeste.com/wp-content/*/js/app.*.js$script,~third-party +||revistaoeste.com/revista/$inline-script +revistaoeste.com##+js(ra, class, div.loading_content) +revistaoeste.com##+js(rc, expandable, div.expandable) +revistaoeste.com##svg.spinner-eclipse +/\.rugbypass\.com\/plus\/\w/$inline-script,domain=rugbypass.com +rugbypass.com##.plus-article-offer +rugbypass.com##+js(rc, premium-fold-bottom, .premium-fold-bottom) +rugbypass.com##+js(rc, fade, .fade) +scholastic.com##+js(ra, class, body.modal-open, stay) +scholastic.com##div.paywallModalElement,div.modal-backdrop +schwaebische.de##+js(ra, style, body[style], stay) +science.org##div.alert-read-limit +science.org##+js(rc, alert-read-limit__overlay, body.alert-read-limit__overlay, stay) +sciencenews.org##+js(cookie-remover, blaize_session) +sciencesetavenir.fr##div.amorce.manual +sciencesetavenir.fr##+js(ra, class|hidden, .user-paying-content) +||scientificamerican.com/api/tinypass.min.js$script,~third-party +scientificamerican.com##+js(cookie-remover, article_meter) +scotsman.com,yorkshirepost.co.uk##+js(rc, premium|no-entitlement, div.premium.no-entitlement) +||seattletimes.com/wp-content/*/st-advertising-bundle.js$script,~third-party +||seattletimes.com/wp-content/*/st-user-messaging-main-bundle.js$script,~third-party +||sfstandard.com/zephr/$xmlhttprequest,~third-party +||sfstandard.com/api/content/decision/$xmlhttprequest,~third-party +sfstandard.com##+js(cookie-remover, zephr-session) +sfstandard.com##+js(acis, localStorage) +sfstandard.com##+js(acis, sessionStorage) +sfstandard.com##div.sticky +slideshare.net##+js(rc, limit-overlay, .limit-overlay) +slideshare.net##+js(set-local-storage-item, /^/, $remove$) +sofrep.com##+js(cookie-remover, sofrep_news_ids) +sofrep.com##+js(ra, class, div.paywall) +sofrep.com##+js(rc, fader, div.fader) +sofrep.com##div.non-paywall,div#paywall_wrap +spektrum.de##+js(rc, pw-premium, article.pw-premium) +spglobal.com##+js(cookie-remover, count) +startribune.com##div.modal-backdrop +startribune.com##body[class]:style(overflow: auto !important; position: static !important;) +||stereogum.com/_next/static/chunks/pages/*/%5B*.js$script,~third-party +study.com##+js(ra, class, div.faded-content) +study.com##+js(ra, class, div.hidden[ng-non-bindable]) +study.com##div.article-cutoff-div +||suomensotilas.fi/wp-content/plugins/epflpw/js/pw.js$script,~third-party +suomensotilas.fi##+js(rc, epfl-pw-obscured, div.epfl-pw-obscured) +||telegraph.co.uk/martech/js/$script,~third-party +tes.com##+js(cookie-remover, /tg_paywall/) +tes.com##+js(ra, class, div.tg-paywall-body-overlay) +tes.com##div.js-paywall-info,div.tg-paywall-message +||texasmonthly.com/script.js$script,~third-party +texasmonthly.com##div.promo-in-body +the-scientist.com##+js(rc, paywall, div.paywall) +the-scientist.com##div.gated-fader,div#Modal +||theartnewspaper.com/_next/static/chunks/pages/access-allowed-*.js$script,~third-party +||theatlantic.com/zephr/decision-engine$xmlhttprequest,~third-party +theatlantic.com##aside#paywall,div[class^="LostInventoryMessage_"] +||cloudfunctions.net/gated-countView$xmlhttprequest,domain=thediplomat.com +theglobeandmail.com##+js(set, window.Fusion.globalContent._id, 0) +thehindu.com,thehindubusinessline.com##+js(set, window.Adblock, false) +thehindu.com,thehindubusinessline.com##+js(set, window.isNonSubcribed, false) +||theintercept.com$inline-script +thelampmagazine.com##+js(ra, class, div.paywall-gradient) +thelampmagazine.com##section.p-8 +thelogic.co##+js(cookie-remover, firstarticle) +||thenewatlantis.com/*/thenewatlantis/js/gate.js$script,~third-party +||thenewatlantis.com/*/thenewatlantis/js/donate.js$script,~third-party +thenewworld.co.uk##div[data-show-fade-on-noaccess],div[data-show-subs-blocked] +thenewworld.co.uk##+js(ra, data-show-has-access, div[data-show-has-access]) +thepointmag.com##+js(cookie-remover, monthly_history) +thepointmag.com##div.overlay,div#tpopup- +thequint.com##div.zsqcu +thequint.com##+js(ra, class|style, div#story-body-wrapper, stay) +||thesaturdaypaper.com.au/sites/all/modules/custom/node_meter/pw.js$~third-party +/\.thesaturdaypaper\.com\.au\/.+\/(\w+-){3,}/$inline-script,domain=thesaturdaypaper.com.au +thesaturdaypaper.com.au##div.paywall-hard-always-show +thespectator.com##+js(rc, ev-meter-content-class, div.ev-meter-content-class) +thetimes.com##html:style(overflow: auto !important;) +thetimes.com##body:style(overflow: auto !important;) +thetimes.com##+js(rc, TeaserPage, body.TeaserPage) +theweek.com##+js(rc, paywall-locker, div.paywall-locker) +theweek.com##div.kiosq-main-layer +thewrap.com##+js(cookie-remover, blaize_session) +timeshighereducation.com##+js(rc, paywall-fade, div.paywall-fade) +timeshighereducation.com##div.paywall-active +unherd.com##+js(ra, id, div#premiumcontent) +unherd.com##div#premiumpreview +valeursactuelles.com##div.qiota +valeursactuelles.com##+js(ra, class, div.qiota_reserve, stay) +/\.vn\.at\/.+\/\d{4}\//$inline-script,domain=vn.at +||washingtonpost.com/*/tetro-client/$script,~third-party +||account.winnipegfreepress.com/api/v*/auth/identify$xmlhttprequest,~third-party +winnipegfreepress.com##.billboard-ad-space,.ad,.article-ad,.fixed-sky +||ynet.co.il/*/article/*?rel=plus$inline-script + +! Advance Local +al.com,cleveland.com,lehighvalleylive.com,masslive.com,mlive.com,nj.com,oregonlive.com,pennlive.com,silive.com,syracuse.com##+js(set, window.adiData.entryTags, 0) + +! Australian Community Media +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,standard.net.au,theadvocate.com.au,thecourier.com.au,westernadvocate.com.au##+js(rc, subscribe-truncate, .subscribe-truncate) +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,standard.net.au,theadvocate.com.au,thecourier.com.au,westernadvocate.com.au##+js(rc, subscriber-hider, .subscriber-hider) +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,standard.net.au,theadvocate.com.au,thecourier.com.au,westernadvocate.com.au##+js(rc, hidden, div.flex-col div.hidden, stay) +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,standard.net.au,theadvocate.com.au,thecourier.com.au,westernadvocate.com.au##+js(ra, style, html[style], stay) +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,standard.net.au,theadvocate.com.au,thecourier.com.au,westernadvocate.com.au##+js(ra, style, body[style], stay) +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,standard.net.au,theadvocate.com.au,thecourier.com.au,westernadvocate.com.au##+js(ra, class, div[class^="gradient-mask-"], stay) +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,standard.net.au,theadvocate.com.au,thecourier.com.au,westernadvocate.com.au##div.blocker,.story-generic__iframe,div.transition-all,div[id^="headlessui-dialog"] + +! Arizent +accountingtoday.com,americanbanker.com,benefitnews.com,bondbuyer.com,dig-in.com,financial-planning.com,nationalmortgagenews.com##+js(set, window.contentGating.ungate, true) + +! Condé Nast +/\.com\/[-\w]+$/$script,~third-party,domain=architecturaldigest.com|bonappetit.com|cntraveler.com|epicurious.com|gq.com|newyorker.com|vanityfair.com|vogue.com|wired.com +/www\.vogue\.co\.uk\/[-\w]+$/$script,~third-party +||voguebusiness.com/journey/compiler/build-*.js$script,~third-party +voguebusiness.com##+js(cookie-remover, userId) + +! Crain Communications +adage.com,autonews.com,pionline.com##+js(set, window.Fusion.globalContent._id, 0) +adage.com,autonews.com,pionline.com##+js(set, window.Fusion.globalContent.content_restrictions, {}) +.com/profiles/*/crain_pelcro_user.js$script,~third-party,domain=360dx.com|chicagobusiness.com|crainscleveland.com|crainsdetroit.com|crainsgrandrapids.com|crainsnewyork.com|genomeweb.com|modernhealthcare.com|plasticsnews.com|precisionmedicineonline.com|sustainableplastics.com|tirebusiness.com|utech-polyurethane.com +.com/*/js_$script,~third-party,domain=rubbernews.com +rubbernews.com##+js(ra, class, body[class], stay) +european-rubber-journal.com##+js(rc, truncated, div.truncated) +european-rubber-journal.com##div.article-overlay,div.gradient +modernhealthcare.com##+js(rc, sponsored-article, div.sponsored-article) + +! Daily Mail Group UK +dailymail.co.uk,mailonsunday.co.uk,thisismoney.co.uk##+js(rc, is-paywalled-article, body.is-paywalled-article) +||dailymail.co.uk/static/mol-adverts/$script + +! GEDI.it sites +||huffingtonpost.it/*/news/$inline-script +||lastampa.it/*/news/$inline-script +huffingtonpost.it,lastampa.it##+js(cookie-remover, blaize_session) +huffingtonpost.it,lastampa.it##aside#widgetDP,div[id^="adv"] +||scripts.repubblica.it/pw/pw.js$script,domain=italian.tech|moda.it +italian.tech,moda.it##div#ph-paywall:remove() +italian.tech,moda.it##+js(ra, style, div#article-body, stay) + +! Groupe La Dépêche +centrepresseaveyron.fr,journaldemillau.fr,ladepeche.fr,lindependant.fr,midilibre.fr,nrpyrenees.fr,petitbleu.fr,rugbyrama.fr##+js(ra, style|data-state, div.p402_premium) +centrepresseaveyron.fr,journaldemillau.fr,ladepeche.fr,lindependant.fr,midilibre.fr,nrpyrenees.fr,petitbleu.fr,rugbyrama.fr##div.paywall + +! Groupe SudOuest.fr +sudouest.fr,charentelibre.fr,larepubliquedespyrenees.fr##div.article-premium-footer,div.footer-premium,div.article-body-wrapper.visible-not-premium,div.pub,div.ph-easy-subscription +sudouest.fr,charentelibre.fr,larepubliquedespyrenees.fr##+js(rc, visible-premium, div.visible-premium) + +! Groupe Nice-Matin +||nicematin.com/build/js/viewpay.*.js$script,domain=monacomatin.mc|nicematin.com|varmatin.com + +! Grupo El Comercio +||diariocorreo.pe/pf/dist/engine/react.js$script,~third-party +||elcomercio.pe/pf/dist/engine/react.js$script,~third-party +||gestion.pe/pf/dist/engine/react.js$script,~third-party +diariocorreo.pe,elcomercio.pe,gestion.pe##+js(ra, class|style, .paywall) +diariocorreo.pe,elcomercio.pe,gestion.pe##+js(rc, story-contents--fade, p.story-contents--fade) +diariocorreo.pe,elcomercio.pe,gestion.pe##div[class^="content_gpt"] + +! Grupo El Mercurio +||elmercurio.com/assets/js/merPramV2.js$script,~third-party +||elmercurio.com/assets/js/vendor/modal.js$script,~third-party +||emol.cl/assets/js/merPramV2.js$script,domain=elmercurio.com +||emol.cl/assets/js/vendor/modal.js$script,domain=elmercurio.com +elmercurio.com##+js(rc, lessreadmore, article.lessreadmore, stay) +elmercurio.com##div[id*="bt_readmore_"] +||australvaldivia.cl/impresa/*/assets/vendor.js$script,~third-party +||mercuriovalpo.cl/impresa/*/assets/vendor.js$script,~third-party +||pasedigital.cl/API/User/Status$script,domain=australvaldivia.cl|mercuriovalpo.cl + +! Grupo Prensa Ibérica +diaridegirona.cat,diariocordoba.com,diariodeibiza.es,diariodemallorca.es,elcorreogallego.es,elcorreoweb.es,eldia.es,elperiodico.com,elperiodicodearagon.com,elperiodicoextremadura.com,elperiodicomediterraneo.com,epe.es,farodevigo.es,informacion.es,laopinioncoruna.es,laopiniondemalaga.es,laopiniondemurcia.es,laopiniondezamora.es,laprovincia.es,levante-emv.com,lne.es,mallorcazeitung.es,regio7.cat,superdeporte.es##+js(rc, ft-helper-closenews, p.ft-helper-closenews, stay) + +! Gruppo SAE +gazzettadimodena.it,gazzettadireggio.it,iltirreno.it,lanuovaferrara.it,lanuovasardegna.it##+js(cookie-remover, /__mtr$/) +gazzettadimodena.it,gazzettadireggio.it,iltirreno.it,lanuovaferrara.it,lanuovasardegna.it##div.MuiSnackbar-root + +! Hearst Communications (magazines) +.com/_assets/jam/$script,~third-party,domain=bicycling.com|cosmopolitan.com|countryliving.com|delish.com|elle.com|elledecor.com|esquire.com|goodhousekeeping.com|harpersbazaar.com|housebeautiful.com|menshealth.com|oprahdaily.com|popularmechanics.com|prevention.com|roadandtrack.com|runnersworld.com|townandcountrymag.com|womenshealthmag.com + +! Hearst Communications (newspapers) +ctpost.com,expressnews.com,houstonchronicle.com,nhregister.com,sfchronicle.com,statesman.com,timesunion.com##div#mod-target-div +ctpost.com,expressnews.com,houstonchronicle.com,nhregister.com,sfchronicle.com,statesman.com,timesunion.com##body:style(overflow: visible!important) + +! Il Messaggero (+ regional) +||cedscdn.it/*/PaywallMeter.js$script,domain=corriereadriatico.it|ilgazzettino.it|ilmattino.it|ilmessaggero.it|quotidianodipuglia.it +||cedsdigital.it/*/PaywallMeter.js$script,domain=corriereadriatico.it|ilgazzettino.it|ilmattino.it|ilmessaggero.it|quotidianodipuglia.it +corriereadriatico.it,ilgazzettino.it,ilmattino.it,ilmessaggero.it,quotidianodipuglia.it##+js(ra, subscriptions-section, [subscriptions-section="content"]) +corriereadriatico.it,ilgazzettino.it,ilmattino.it,ilmessaggero.it,quotidianodipuglia.it##[subscriptions-section="content-not-granted"] + +! Industry Dive +||*dive.com/static/js/dist/contentGate.bundle.js$script,~third-party +.com/static/js/dist/contentGate.bundle.js$script,~third-party,domain=cfo.com|pharmavoice.com|proformative.com|socialmediatoday.com + +! Landwirtschaftsverlag +profi.de,topagrar.com,wochenblatt.com##+js(ra, class|style, div.paywall-full-content[style]) +profi.de,wochenblatt.com##div.m-paywall__textFadeOut,div[id^="paymentprocess-"] +||topagrar.com/*/news/$inline-script +topagrar.com##div.paywall-package + +! Madsack sites +cz.de,dewezet.de,dieharke.de,dnn.de,gnz.de,goettinger-tageblatt.de,haz.de,kn-online.de,landeszeitung.de,ln-online.de,lvz.de,maz-online.de,ndz.de,neuepresse.de,op-marburg.de,ostsee-zeitung.de,paz-online.de,remszeitung.de,rga.de,rnd.de,saechsische.de,siegener-zeitung.de,szlz.de,sn-online.de,solinger-tageblatt.de,tah.de,torgauerzeitung.de,waz-online.de##+js(set, window.Fusion.globalContent.isPaid, false) + +! Maine Trust for Local News +||bc.*.com/script.js$script,~third-party,domain=centralmaine.com|pressherald.com|sunjournal.com + +! McClatchy Group +||mcclatchy.com/mcc-paywall.js$script,third-party + +! Mediahuis Belgie +/extra/assets/resources/js/zephrIntegration.js$script,~third-party,domain=gva.be|hbvl.be|nieuwsblad.be|standaard.be + +! Mediahuis Noord +||ndcmediagroep.nl/js/evolok/$script,third-party + +! MediaNews Group & Tribune Publishing Company +.com/wp-content/plugins/loader-wp/static/loader.min.js$script,~third-party +bostonherald.com,denverpost.com,eastbaytimes.com,mercurynews.com,ocregister.com,pressenterprise.com,sandiegouniontribune.com,twincities.com##+js(ra, subscriptions-section, [subscriptions-section="content"]) +bostonherald.com,denverpost.com,eastbaytimes.com,mercurynews.com,ocregister.com,pressenterprise.com,sandiegouniontribune.com,twincities.com##[subscriptions-section="content-not-granted"] + +! Motor Presse Stuttgart +.de/thenewsbar/config/$xmlhttprequest,~third-party,domain=aerokurier.de|auto-motor-und-sport.de|flugrevue.de|motorradonline.de|womenshealth.de + +! Oahu Publications +staradvertiser.com##div.fade +staradvertiser.com##+js(ra, style, div#hsa-paywall-content[style], stay) +staradvertiser.com##+js(rc, overflow-hidden, body.overflow-hidden, stay) + +hawaiitribune-herald.com,thegardenisland.com,westhawaiitoday.com##+js(ra, style, div#single-paywall, stay) +hawaiitribune-herald.com,thegardenisland.com,westhawaiitoday.com##div#single-login-box,div#single-excerpt + +! Persgroep +/temptation/resolve$xmlhttprequest,~third-party,domain=demorgen.be|flair.nl|humo.be|libelle.nl|margriet.nl|parool.nl|trouw.nl|volkskrant.nl +||temptation.*/temptation.js$script,~third-party,domain=demorgen.be|flair.nl|humo.be|libelle.nl|margriet.nl|parool.nl|trouw.nl|volkskrant.nl +@@||myprivacy-static.dpgmedia.net/consent.js$script,third-party +@@/wrapperMessagingWithoutDetection.js$script,~third-party,domain=demorgen.be|flair.nl|humo.be|libelle.nl|margriet.nl|parool.nl|trouw.nl|volkskrant.nl + +! DPG ADR (no scroll) +||temptation.*/temptation.js$script,~third-party,domain=ad.nl|bd.nl|bndestem.nl|destentor.nl|ed.nl|gelderlander.nl|pzc.nl|tubantia.nl|hln.be +||temptation.*/rest/$xmlhttprequest,~third-party,domain=ad.nl|bd.nl|bndestem.nl|destentor.nl|ed.nl|gelderlander.nl|pzc.nl|tubantia.nl|hln.be + +! Private Media Australia +crikey.com.au,smartcompany.com.au,themandarin.com.au##+js(cookie-remover, blaize_session) + +! Ringier Axel Springer Polska +auto-swiat.pl,businessinsider.com.pl,forbes.pl,komputerswiat.pl,newsweek.pl,onet.pl##+js(ra, class|style, div.contentPremium[style]) +businessinsider.com.pl##div#content-premium-offer + +! Roularta Media Groep +||artsenkrant.com/js/responsive/rmgModal.js$script,~third-party +||artsenkrant.com/js/responsive/rmgPaywall.js$script,~third-party +artsenkrant.com##div.article-body > p +artsenkrant.com##+js(ra, class, div.article-body > div) +artsenkrant.com##+js(rc, locked, body.locked) +artsenkrant.com,femmesdaujourdhui.be,flair.be,knack.be,kw.be,levif.be,libelle.be##div[id*="wall-modal"] +artsenkrant.com,femmesdaujourdhui.be,flair.be,knack.be,kw.be,levif.be,libelle.be##+js(ra, class|style, html, stay) +beleggersbelangen.nl##+js(rc, no-account, div.no-account) +beleggersbelangen.nl##+js(ra, style, div.content-inner[style]) +beleggersbelangen.nl##div.unlimited-access +!#if (env_firefox) +/\.(femmesdaujourdhui|flair|knack|levif|libelle)\.be\/.+\/(\w+-){2,}/$inline-script +!#endif + +! Südwest Media Network +schwarzwaelder-bote.de,stuttgarter-nachrichten.de,stuttgarter-zeitung.de##+js(rc, restricted-area, div.restricted-area, stay) +schwarzwaelder-bote.de,stuttgarter-nachrichten.de,stuttgarter-zeitung.de##div.mod-paywall + +! Tamedia.ch Group +24heures.ch,bazonline.ch,derbund.ch,tagesanzeiger.ch,tdg.ch##+js(cookie-remover, xbc) + +! TechTarget sites +computerweekly.com,lemagit.fr,techtarget.com##+js(rc, paywall, div.paywall, stay) +computerweekly.com,lemagit.fr,techtarget.com##p#firstP,div#inlineRegistrationWrapper + +! The Epoch Times sites (main + br|cz|de|fr|il|jp|ro) +||theepochtimes.com/rules/get$xmlhttprequest,~third-party +||epochbase.com/libs/paywall*.js$script,third-party +||epochbase.com/rules/get$xmlhttprequest,third-party +||epochbase.eu/rules/get$xmlhttprequest,third-party +/\/epoch\.org\.il\/.+\/\d{5,}\//$inline-script,domain=epoch.org.il + +! The Local Group (EU) +thelocal.at,thelocal.ch,thelocal.com,thelocal.de,thelocal.dk,thelocal.es,thelocal.fr,thelocal.it,thelocal.no,thelocal.se##+js(ra, style, div#articleBody, stay) +thelocal.at,thelocal.ch,thelocal.com,thelocal.de,thelocal.dk,thelocal.es,thelocal.fr,thelocal.it,thelocal.no,thelocal.se##p#articleBodyForbidden,div.tl-ad-container,div.ml-manual-widget-container + +! additional adblocker-fix +||flowerstreatment.com^$third-party +||guidecent.com^$script,third-party +||memberstack.com/scripts/v*/memberstack.js$script,third-party +policorner.ca##div.free-text,div.subscribe-box +/wp-content/plugins/incognito_dectector/$script,~third-party + +||jeuneafrique.com/cdn-cgi/trace$xmlhttprequest,~third-party +||assets.guim.co.uk/assets/SignInGate*.js$script,domain=theguardian.com +theguardian.com##[name="SlotBodyEnd"],div[data-cy="contributions-liveblog-epic"] + +@@||consentmanager.net$script,third-party +#@#.cmpwrapper +@@||cookielaw.org^$xmlhttprequest,domain=blick.ch +@@||sdk.privacy-center.org^$script,third-party +@@/wrapperMessagingWithoutDetection.js$script,~third-party,domain=handelsblatt.com +!##div#didomi-host +##+js(rc, didomi-popup-open, body.didomi-popup-open) +||htlbid.com$script,third-party + +! flip-pay +||flip-pay.com/*/flip-pay.js$script,third-party,domain=clareecho.ie|thedailymash.co.uk +clareecho.ie##+js(rc, td-post-content, div.td-post-content) + +! Wallkit +##+js(ra, class, div.wkwp-paywall) +##div.wkwp-paywall-block + +! custom sites +.com/webfiles/*/js/metering.js$script,third-party,domain=hbook.com|libraryjournal.com|slj.com +20minutes.fr##+js(rc, qiota_reserve, div.qiota_reserve) +||20minutes.fr/v-ajax/subscribe-modal$xmlhttprequest,~third-party +aaii.com##+js(rc, fadeout, .fadeout) +aaii.com##.greybox-signup +aftenposten.no##div.hyperion-css-1cc2qe9,div[class^="advertory-"],button[aria-controls="summary-details"] +aftenposten.no##body:style(overflow: auto !important) +aftenposten.no##+js(ra, class, div#summary-details) +amboss.com##+js(cookie-remover, ssobma) +amboss.com##div#optly-remaining-articles-banner,div[class^="InfoBanner_InfoBanner"] +||anandabazar.com/subscription-assets/js/paywall*.js$script,~third-party +||anandabazar.com/*/cid/$inline-script +anandabazar.com##div.paywallouterbox,div.readarticlebox,div.showmorebox +anandabazar.com##+js(ra, class, div.readmoreouterbox, stay) +anandabazar.com##+js(ra, id, article#outerboxarticlebox, stay) +anandabazar.com##+js(ra, class, div.expcontainer, stay) +||tinypass.com/api/tinypass.min.js$script,domain=arabianbusiness.com +arabianbusiness.com##+js(ra, class, div.ev-meter-content, stay) +||arktimes.com/wp-content/plugins/newspack-plugin/dist/memberships-gate-metering.js$script,~third-party +||atribuna.com.br/assets/js-v*/story.js$script,~third-party +babi.sh##+js(ra, style, div[style*="filter:blur"], stay) +babi.sh##+js(ra, style, div[style*="; overflow: hidden"][style*="; height:"], stay) +babi.sh##div[style="width: 100%; opacity: 1; transform: none;"] +bisnow.com##+js(ra, style, div.story-container > p[style], stay) +bisnow.com##div.storyLogin +bizwest.com##div.fp-paywall +bizwest.com##+js(ra, class, div.fp-content) +boredpanda.com##+js(rc, open-list-items, div.open-list-items) +boredpanda.com##div#show-all-images-block-premium +||boston.com/api/tinypass.min.js$script,~third-party +brainly.com,brainly.com.br##+js(set-local-storage-item, /^/, $remove$) +||account.brandonsun.com/api/v*/auth/identify$xmlhttprequest,~third-party +brusselstimes.com##+js(ra, style, div[style*="height: 0;"], stay) +businessden.com,richmondbizsense.com##+js(ra, class, div.cp-paywall-user) +businessden.com,richmondbizsense.com##div#copperpress-paywall +businesstoday.in##+js(cookie-remover, magazineSession) +businesstoday.in##div#magazinePayWallStrip +||nitrocdn.com/*/paywall.$script,domain=capitalaberto.com.br +cardiologie-pratique.com##+js(ra, class, div.wrap-node, stay) +cmcmarkets.com##+js(rc, activePaywall, .activePaywall) +||cnv-medien.de$inline-script +connexionfrance.com##+js(cookie-remover, /^/) +connexionfrance.com##div#subscribe-banner +||diariodonordeste.verdesmares.com.br/js/com.atex.gong.paywall.membership.js$script,~third-party +divisare.com##div.blocker +divisare.com##+js(ra, style, body[style], stay) +dominionpost.com##+js(rc, entry-content, article > div.entry-content) +elfinancierocr.com##+js(ra, style, div.article-body-wrapper__styled[style]) +elfinancierocr.com##div.post +epaper.indiatimes.com##div.epaperBlockerWrap +/\/every\.to\/[-\w]+\//$inline-script +every.to##+js(ra, style, div#post-body-full, stay) +||eviemagazine.com/api/trpc/post.paywall$xmlhttprequest,~third-party +expressandstar.com,shropshirestar.com##+js(set, window.Fusion.globalContent.paywallStatus, false) +||fokus.se/app/plugins/sesamy-fpg/assets/js/sesamy-fpg.js$script,~third-party +forbes.sk##+js(ra, style, div.post-content-soft-paywall, stay) +forbes.sk##div#custom-html-locker +gocomics.com##div[data-paywall] +gocomics.com##html:style(overflow: auto !important;) +||golf.com/wp-content/themes/golf/compiled/js/wsumApp.js$script,~third-party +gothamist.com##+js(rc, leadin, div.leadin, stay) +gothamist.com##div.wall-wrapper +hartfordbusiness.com##+js(ra, style, div.expandable-paywall-premium-content[style], stay) +hartfordbusiness.com##div.paywall-container +hcn.org##+js(ra, content, meta[name="UID"]) +heatmap.news##+js(ra, style, div.body-description, stay) +heatmap.news##div.regwall-container +inman.com##+js(rc, paywalled-block, .paywalled-block) +inman.com##+js(ra, class, div.entry-content-inner) +inman.com##div.content-wrap > div:not([class]):style(margin: 5% !important) +inman.com##.ism-article-block +||cloudfront.net/imonkey-blog-*.min.js$script,domain=insidermonkey.com +ipsoa.it##+js(ra, style, div.paywall) +||jerseyeveningpost.com$inline-script +||jewishinsider.com/wp-content/themes/jewish-insider/js/owl.carousel.min.js$script,~third-party +||jornaldocomercio.com/*/json/paywall.json$xmlhttprequest,~third-party +jornaljoca.com.br##+js(acis, $, paywall) +kommersant.ru##+js(rc, doc--regwall, article.doc--regwall, stay) +kommersant.ru##section.regwall +kunststoffe.de,qz-online.de##+js(ra, style, div[style^="filter: blur"], stay) +kunststoffe.de,qz-online.de##dialog#paywall-dialog +||lapost.com$inline-script +lapost.com##+js(ra, style, div.article-content, stay) +||lasvegasadvisor.com/opt/*.js$script,~third-party +||lasvegasadvisor.com/js/access.min.js$script,~third-party +lavialibera.it##+js(ra, class, div.text-preview) +lavialibera.it##div.save_modal +legalbites.in##+js(ra, class, div.hide.paywall-content) +legalbites.in##div#subscription_paid_message,div.restricted_message > div.story +lepetitjournal.net##.message-restricted-woocommerce +lepetitjournal.net##+js(rc, excerpt, div.excerpt) +lydogbillede.dk,lydogbilde.no##+js(rc, thecontent, div.thecontent) +lydogbillede.dk,lydogbilde.no##+js(ra, style, div#MoreLink_content-container[style]) +lydogbillede.dk,lydogbilde.no##div.paywallbox,div#MoreLink_fade-out-div +marketnews.com##+js(ra, class, div.body-description) +||cloudfront.net/js/prometeo-media/$script,domain=menorca.info|ultimahora.es +meritnation.com##.view-full-answer +meritnation.com##+js(rc, maxHeight75px, div.exp_content.maxHeight75px) +||moscout.com$inline-script +museumsassociation.org##+js(rc, paywall, body.paywall) +museumsassociation.org##+js(ra, style, body[style], stay) +museumsassociation.org##div#paywall-wrapper,div.advertising +||musicomh.com/wp-content/*/bundle.js$script,~third-party +nacion.com##+js(ra, style, div.article-body-wrapper__styled[style], stay) +nacion.com##div.post +narcity.com##+js(ra, style, div.body-description[style], stay) +narcity.com##div#login-wall,div#overlay,div.brid-container,div.brandsnippet-article,div[class$='ad-wrapper'] +||newbostonpost.com/*/paywall/js/main.js$script,~third-party +newoxfordreview.org##+js(rc, not-viewable, div.not-viewable) +nu.nl##+js(rc, authorized-content, div.authorized-content, stay) +nu.nl##+js(rc, semi-authorized-content, div.semi-authorized-content, stay) +nu.nl##article#LOGIN +||odt.co.nz/bwtw/scripts/tw.js$script,~third-party +odt.co.nz##+js(ra, property, div[property="content:encoded"]) +opopular.com.br##+js(rc, restricted, div.restricted, stay) +opopular.com.br##div.PJLV-ihxtsVt-css +||opovo.com.br/*/js/auth/auth_new_menu.min.js$script,~third-party +||pebmed.com.br/wp-content/*/paywall/dist/js/app.js$script,~third-party +||perspectivemedia.com/wp-admin/admin-ajax.php$xmlhttprequest,~third-party +perspectivemedia.com##div.hustle-ui +popbitch.com##+js(ra, class, div[class*="-premium"]) +psypost.org##+js(cookie-remover, issuem_lp) +publishersweekly.com##+js(ra,class|style,div#contentdiv.loggedInOnly,stay) +publishersweekly.com##div#contentdiv.loggedOutOnly +||racketmn.com/_next/*/%5BsiteSlug*.js$script,~third-party +||racquetmag.com/_next/*/%5BsiteSlug*.js$script,~third-party +||rdhmag.com$inline-script +rockdelux.com##+js(ra, class|style, body, stay) +rockdelux.com##+js(ra, style, div#body, stay) +rockdelux.com##div.bg-paywall +rotowire.com##+js(ra, class, div.pw-content) +rotowire.com##div.paywall-full,div.article-preview-fader +||serenitymarkets.com/wp-content/themes/Divi-child/assets/js/encriptar.js$script,~third-party +serenitymarkets.com##+js(ra, class, div.blur_content, stay) +||shrm.org/*/js/paywall*.js$script,~third-party +skepticalinquirer.org##+js(rc, google-bot, div.google-bot, stay) +solarserver.de##+js(ra, style, div.paywall) +solarserver.de##+js(ra, class, div.paywall-blurred) +solarserver.de##div.paywall-box +/\.solicitorsjournal\.com\/_next\/static\/chunks\/\d.+\.js/$script,domain=solicitorsjournal.com,~third-party +||southernstar.ie/js/tollbridge.js$script,~third-party +speakup.it##div.paywall-container +||spectrejournal.com/wp-content/plugins/elementor/*/dialog.min.js$script,~third-party +spiked-online.com##+js(set-local-storage-item, nudges, {}) +splainer.in##+js(rc, hide-section, .hide-section) +splainer.in##.subscription-prompt +||splinter.com/wp-content/themes/pastemagazine/js/pm_custom.js$script,~third-party +standcolumbia.org##+js(ra, class, div.stu-lock-content, stay) +standcolumbia.org##div.stu-blur-overlay +stateaffairs.com##div.c-memberships-message +stateaffairs.com##+js(rc, access-restricted, body.access-restricted) +stockunlock.com##div[class*="-root"][class*="css-"]:style(filter: none !important; pointer-events: auto !important) +stockunlock.com##div.css-coxdc8 +strangematters.coop##+js(cookie-remover, pmpro_lpv_count) +subscriptioninsider.com##+js(rc, dialog-prevent-scroll, body.dialog-prevent-scroll, stay) +subscriptioninsider.com##div.dialog-widget +!#if (adguard_app_ios) +/\.subscriptioninsider\.com\/.+\/(\w+-){3,}/$inline-script,domain=subscriptioninsider.com +!#endif +thecore.in##+js(ra, class, div.paywall-content) +thecore.in##div.story,div#subscription_paid_message,div#footer_login_wall +thecountersignal.com##+js(ra, class, body.single div.elementor-widget-container) +||thedriftmag.com/wp-content/plugins/drift-paywall-plugin/$script,~third-party +theindianalawyer.com##+js(rc, restricted-non-subscriber, article.restricted-non-subscriber) +theindianalawyer.com##+js(ra, style, article-content>p) +theindianalawyer.com##div#vue-growler,div#js-modal +thejc.com##+js(ra, class, div.paywall, stay) +thejc.com##div.poool-widget +||thenationalpulse.com/wp-content/*/assets/js/national-pulse.js$script,~third-party +||theschooloflife.com/app/plugins/*/woocommerce.min.js$script,~third-party +aap.thestreet.com##+js(rc, is-paywalled, body.is-paywalled) +realmoney.thestreet.com##+js(cookie-remover, /^PWT/) +||thetablet.org$inline-script +thetablet.org##+js(rc, gated-content, body.gated-content) +tidningenridsport.se##+js(ra, class|style, div.mctos) +tidningenridsport.se##+js(rc, cli-barmodal-open, body.cli-barmodal-open) +tidningenridsport.se##div.locked +timeslive.co.za##+js(set, window.Fusion.globalContent.content_restrictions, {}) +trailsoffroad.com##.paywall +wbjournal.com##+js(ra, style, div.expandable-paywall-premium-content, stay) +wbjournal.com##div.paywall-container +wbez.org##div.email-wall-content-lock:remove() +||zeitzeichen.net/sites/default/files/js/js_*.js$script,~third-party + +! Arena Holdings (ZA) +businessday.co.za,dailydispatch.co.za,sowetan.co.za,theherald.co.za,timeslive.co.za##section.b-paywall__overlay +businessday.co.za,dailydispatch.co.za,sowetan.co.za,theherald.co.za,timeslive.co.za##+js(ra, style, html, stay) + +! General (amp) +||ampproject.org/*/amp-access-$script,domain=~cambridge.org|~cmjornal.pt +||ampproject.org/*/amp-subscriptions-$script +@@||ampproject.org/v0/amp-consent-$script + +artnet.com,bostonglobe.com,dallasnews.com,latimes.com,sandiegouniontribune.com##+js(ra, subscriptions-section, [subscriptions-section="content"]) +artnet.com,bostonglobe.com,dallasnews.com,latimes.com,sandiegouniontribune.com##[subscriptions-section="content-not-granted"] +digiday.com,inc42.com,indianexpress.com,indiatoday.in,mid-day.com,telegraph.co.uk##+js(ra, amp-access-hide, [amp-access][amp-access-hide]) + +! French/Belgian sites +amp.elle.fr,challenges.fr,sciencesetavenir.fr##+js(ra, amp-access-hide, [amp-access][amp-access-hide]) +! Groupe IPM +dhnet.be,lalibre.be,lavenir.net,moustique.be##+js(rc, is-preview, div.preview) +dhnet.be,lalibre.be,lavenir.net,moustique.be##+js(rc, is-hidden, div.is-hidden) + +! Australia News Corp +adelaidenow.com.au,cairnspost.com.au,codesports.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##+js(ra, subscriptions-section, [subscriptions-section="content"]) +adelaidenow.com.au,cairnspost.com.au,codesports.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##[subscriptions-section="content-not-granted"] + +! Italian sites +corriere.it,ilfattoquotidiano.it,ilfoglio.it##+js(ra, subscriptions-section, [subscriptions-section="content"]) +corriere.it,ilfattoquotidiano.it,ilfoglio.it##[subscriptions-section="content-not-granted"] +! Quotidiano.net (+ regional) +ilgiorno.it,ilrestodelcarlino.it,iltelegrafolivorno.it,lanazione.it,quotidiano.net##+js(ra, amp-access-hide, [amp-access][amp-access-hide]) + +! McClatchy Group +amp.bnd.com,amp.charlotteobserver.com,amp.elnuevoherald.com,amp.fresnobee.com,amp.kansas.com,amp.kansascity.com,amp.kentucky.com,amp.mcclatchydc.com,amp.miamiherald.com,amp.newsobserver.com,amp.sacbee.com,amp.star-telegram.com,amp.thestate.com,amp.tri-cityherald.com##+js(ra, subscriptions-section, [subscriptions-section="content"]) +amp.bnd.com,amp.charlotteobserver.com,amp.elnuevoherald.com,amp.fresnobee.com,amp.kansas.com,amp.kansascity.com,amp.kentucky.com,amp.mcclatchydc.com,amp.miamiherald.com,amp.newsobserver.com,amp.sacbee.com,amp.star-telegram.com,amp.thestate.com,amp.tri-cityherald.com##[subscriptions-section="content-not-granted"] +amp.sacbee.com##+js(ra, subscriptions-action, div[subscriptions-action][subscriptions-display="NOT data.hasError"]) + +! Nine Entertainment (Australia) +amp.brisbanetimes.com.au,amp.smh.com.au,amp.theage.com.au,amp.watoday.com.au##+js(ra, subscriptions-section, [subscriptions-section="content"]) +amp.brisbanetimes.com.au,amp.smh.com.au,amp.theage.com.au,amp.watoday.com.au##[subscriptions-section="content-not-granted"] + +! Spanish/Portugese/Brazilian/Colombian sites +amp.elmundo.es,amp.expansion.com,amp.marca.com,elespanol.com,em.com.br,folha.uol.com.br,gazetadopovo.com.br##+js(ra, subscriptions-section, [subscriptions-section="content"]) +amp.elmundo.es,amp.expansion.com,amp.marca.com,elespanol.com,em.com.br,folha.uol.com.br,gazetadopovo.com.br##[subscriptions-section="content-not-granted"] +eldiario.es,elespectador.com,elpais.com,estadao.com.br,infolibre.es,sabado.pt##+js(ra, amp-access-hide, [amp-access][amp-access-hide]) +! Grupo Vocento +abc.es,canarias7.es,diariosur.es,diariovasco.com,elcomercio.es,elcorreo.com,eldiariomontanes.es,elnortedecastilla.es,hoy.es,ideal.es,larioja.com,lasprovincias.es,laverdad.es,lavozdigital.es##+js(ra, amp-access-hide, [amp-access][amp-access-hide]) +abc.es##+js(ra, id, body#top) diff --git a/userscript/bpc.de.user.js b/userscript/bpc.de.user.js new file mode 100644 index 0000000..5c461d0 --- /dev/null +++ b/userscript/bpc.de.user.js @@ -0,0 +1,1257 @@ +// ==UserScript== +// @name Bypass Paywalls Clean - de/at/ch +// @version 4.2.3.6 +// @description Bypass Paywalls of news sites +// @author magnolia1234 +// @downloadURL https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters/blob/raw?file=userscript/bpc.de.user.js +// @updateURL https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters/blob/raw?file=userscript/bpc.de.user.js +// @homepageURL https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters +// @supportURL https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters +// @license MIT; https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters/blob/raw?file=LICENSE +// @noframes +// @match *://*.de/* +// @match *://*.beobachter.ch/* +// @match *://*.blick.ch/* +// @match *://*.faz.net/* +// @match *://*.handelsblatt.com/* +// @match *://*.handelszeitung.ch/* +// @match *://*.kurier.at/* +// @match *://*.nzz.ch/* +// @match *://*.profil.at/* +// @match *://*.schweizermonat.ch/* +// @match *://*.themarket.ch/* +// @match *://*.vn.at/* +// @match *://*.vol.at/* +// @match *://*.wochenblatt.com/* +// @connect archive.fo +// @connect archive.is +// @connect archive.li +// @connect archive.md +// @connect archive.ph +// @connect archive.vn +// @connect fnetcore-api-prod.azurewebsites.net +// @connect funkemedien.de +// @grant GM.xmlHttpRequest +// @require https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters/blob/raw?file=userscript/bpc_func.js +// ==/UserScript== + +(function() { + //'use strict'; + +if (matchDomain('automobilwoche.de')) { + function automobilwoche_main() { + if (window.Fusion) { + window.Fusion.globalContent._id = 0; + window.Fusion.globalContent.content_restrictions = {}; + } + } + window.setTimeout(function () { + insert_script(automobilwoche_main); + }, 100); +} + +window.setTimeout(function () { + +var de_funke_medien_domains = ['abendblatt.de', 'braunschweiger-zeitung.de', 'harzkurier.de', 'ikz-online.de', 'morgenpost.de', 'nrz.de', 'otz.de', 'thueringer-allgemeine.de', 'tlz.de', 'waz.de', 'wp.de', 'wr.de']; +var de_ippen_media_domains = ['fr.de', 'merkur.de', 'ovb-online.de']; +var de_lv_domains = ['profi.de', 'wochenblatt.com']; +var de_madsack_domains = ['haz.de', 'kn-online.de', 'ln-online.de', 'lvz.de', 'maz-online.de', 'neuepresse.de', 'ostsee-zeitung.de', 'rnd.de', 'saechsische.de']; +var de_motor_presse_domains = ['aerokurier.de', 'auto-motor-und-sport.de', 'flugrevue.de', 'motorradonline.de', 'womenshealth.de']; +var de_rp_medien_domains = ['ga.de', 'rp-online.de', 'saarbruecker-zeitung.de', 'volksfreund.de']; +var de_smn_domains = ['schwarzwaelder-bote.de', 'stuttgarter-nachrichten.de', 'stuttgarter-zeitung.de']; +var de_smn_custom_domains = ['cannstatter-zeitung.de', 'esslinger-zeitung.de', 'frankenpost.de', 'insuedthueringen.de', 'krzbb.de', 'kurier.de', 'np-coburg.de']; +var de_vrm_domains = ['allgemeine-zeitung.de', 'echo-online.de', 'wiesbadener-kurier.de']; +var de_vrm_custom_domains = ['buerstaedter-zeitung.de', 'hochheimer-zeitung.de', 'lampertheimer-zeitung.de', 'lauterbacher-anzeiger.de', 'main-spitze.de', 'mittelhessen.de', 'oberhessische-zeitung.de', 'wormser-zeitung.de']; + +if (matchDomain('aachener-zeitung.de')) { + let url = window.location.href; + getArchive(url, 'div[data-testid="paywall-position-popover"]', '', 'article'); + let shade = document.querySelector('div.paywalled-article'); + if (shade) + shade.classList.remove('paywalled-article'); + let noscroll = document.querySelectorAll('html[class], body[class]'); + for (let elem of noscroll) + elem.removeAttribute('class'); + let ads = 'section[data-theme-sponsored-content]'; + hideDOMStyle(ads); +} + +else if (matchDomain('aerztezeitung.de')) { + let paywall = document.querySelector('div.AZLoginModule'); + if (paywall) { + removeDOMElement(paywall); + let json_script = getArticleJsonScript(); + if (json_script) { + let json = JSON.parse(json_script.text); + if (json) { + let json_text = json.articleBody; + let content = document.querySelector('p.intro'); + if (json_text && content) { + let article_new = document.createElement('p'); + article_new.innerText = json_text; + content.after(article_new); + } + } + } + } +} + +else if (matchDomain('automobilwoche.de')) { + let banners = 'div#piano-paywall-container'; + hideDOMStyle(banners); +} + +else if (matchDomain(['beobachter.ch', 'handelszeitung.ch'])) { + window.setTimeout(function () { + let paywall = document.querySelector('div#piano-inlined'); + if (paywall) { + removeDOMElement(paywall); + let fade = document.querySelector('div.article-body > div.paywall-wrapper-with-print-info'); + removeDOMElement(paywall, fade); + let json_script = document.querySelector('script#hydrationdata'); + if (json_script) { + try { + let json = JSON.parse(json_script.text); + if (json) { + let url_id = json_script.text.includes('"gcid":"') ? json_script.text.split('"gcid":"')[1].split('"')[0] : ''; + if (url_id && !window.location.pathname.endsWith(url_id)) + refreshCurrentTab(); + let pars = json.state; + let paragraphs = document.querySelectorAll('div.paragraph'); + let article = paragraphs[0]; + if (article) { + article.setAttribute('class', 'paragraph text-paragraph'); + for (let paragraph of paragraphs) + paragraph.innerHTML = ''; + let parser = new DOMParser(); + let img_first = true; + let img_use = false; + let img_caption; + for (let par in pars) { + let par_elem = pars[par]; + let elem = document.createElement('div'); + elem.style = 'font-size: 1.7rem; margin: 25px;'; + let sub_elem; + if (par_elem.__typename === 'TextParagraph' && par_elem.text) { + let content_new = parser.parseFromString('
' + par_elem.text + '
', 'text/html'); + sub_elem = content_new.querySelector('div'); + } else if (par_elem.__typename === 'EmbedParagraph' && par_elem.embedCode) { + let content_new = parser.parseFromString('
' + par_elem.embedCode + '
', 'text/html'); + sub_elem = content_new.querySelector('div'); + let iframe = sub_elem.querySelector('iframe[width]'); + if (iframe) { + let ratio = iframe.width / (mobile ? 320 : 640); + iframe.width = iframe.width / ratio; + iframe.height = iframe.height / ratio; + } + } else if (par_elem.__typename === 'ImageFile') { + if (par_elem.origin) { + if (!img_first) { + let img_attrib = {alt: par_elem.alt}; + if (par_elem.width) { + let ratio = par_elem.width / (mobile ? 320 : 640); + img_attrib.width = par_elem.width / ratio; + img_attrib.height = par_elem.height / ratio; + } + sub_elem = makeFigure(par_elem.origin, '_', img_attrib); + img_caption = sub_elem.querySelector('figcaption'); + img_use = true; + } else + img_first = false; + } + } else if (par_elem.__typename === 'Image') { + if (img_use && img_caption && par_elem.credit) + img_caption.after('Quelle: ', par_elem.credit); + } else if (par_elem.__typename === 'ImageParagraph') { + if (img_use && img_caption && par_elem.caption) + img_caption.innerText = par_elem.caption.replace(/(<\/?[^>]+>)/g, ''); + } else if (par_elem.__typename === 'MinistageParagraph') { + if (par_elem.ministage && par_elem.ministage.headline) { + sub_elem = document.createElement('p'); + sub_elem.append(par_elem.ministage.headline, ' - ' + par_elem.ministage.lead); + if (par_elem.ministage.link) { + let sub_link = document.createElement('a'); + sub_link.href = par_elem.ministage.link.path; + sub_link.innerText = par_elem.ministage.link.label; + sub_elem.append(document.createElement('br'), sub_link); + } + } + } else if (par_elem.__typename === 'ListicleItemParagraph') { + if (par_elem.title &&par_elem.text && par_elem.link && par_elem.link.path) { + sub_elem = document.createElement('a'); + sub_elem.href = par_elem.link.path; + sub_elem.innerText = par_elem.title + ' - ' + par_elem.text.replace(/(<\/?[^>]+>)/g, ''); + } + } else if (par_elem.__typename === 'Product') { + if (par_elem.title && par_elem.link && par_elem.link.path) { + sub_elem = document.createElement('a'); + sub_elem.href = par_elem.link.path; + sub_elem.innerText = (par_elem.shortTitle ? par_elem.shortTitle + ' - ' : '') + par_elem.title; + } + } else if (!['Article', 'Author', 'BlockquoteParagraph', 'Channel', 'InfoBoxParagraph', 'LandingPage', 'Query', 'TeaserParagraph', 'TeaserStageParagraph'].includes(par_elem.__typename)) { + console.log(par_elem); + } + if (sub_elem) { + elem.appendChild(sub_elem); + article.appendChild(elem); + } + } + } + } + } catch (err) { + console.log(err); + } + } + } + }, 1000); + let ads = 'div.ad-wrapper, div[id^="apn-ad-slot-"], div[class^="piano-article-aside"]'; + hideDOMStyle(ads); +} + +else if (matchDomain('berliner-zeitung.de')) { + let url = window.location.href; + getArchive(url, 'div[class^="soft-paywall_wrapper_"]', '', 'div#articleBody'); + let ads = 'div[class^="traffective_"], div[class^="article_billboard-"], div[class*="_ad_"], div[class^="outbrain_"], div[id^="qmn-ad-"], div[style]:empty'; + hideDOMStyle(ads); +} + +else if (matchDomain('bild.de')) { + func_post = function () { + if (mobile) { + let lazy_images = document.querySelectorAll('figure img[loading="lazy"][style]'); + for (let elem of lazy_images) { + elem.style = 'width: 95%; margin: 10px;'; + elem.parentNode.removeAttribute('style'); + } + let header = document.querySelector('article > h2 > span:last-child'); + if (header) + header.style = 'margin: 10px;'; + let content = document.querySelector('article time ~ div'); + if (content) + content.style = 'margin: 10px;'; + } + let div_empty = document.querySelectorAll('div[style]'); + for (let elem of div_empty) + if (!elem.innerText.length) + removeDOMElement(elem); + let article = document.querySelector('main > article'); + if (article && article.innerText.length < 1000) + header_nofix('h2', '', 'BPC > no archive-fix'); + } + let url = window.location.href; + getArchive(url, 'div.offer-module', '', 'article'); +} + +else if (matchDomain('blick.ch')) { + let ads = 'aside[class*="slot-code"], aside[class*="_teaser_"][class*="slot-code"]'; + hideDOMStyle(ads); +} + +else if (matchDomain('boersen-zeitung.de')) { + window.setTimeout(function () { + let paywall = document.querySelector('storefront-section#paywall'); + if (paywall) { + removeDOMElement(paywall); + let url = window.location.href; + replaceDomElementExt(url, false, false, 'article'); + } + }, 2000); +} + +else if (matchDomain('cicero.de')) { + let url = window.location.href; + getArchive(url, 'div.plenigo-paywall', '', 'article > div:has(> div.ad-container)', '', 'article > div:has(h3)'); +} + +else if (matchDomain('faz.net')) { + let paywall = document.querySelector('div.wall'); + if (paywall) { + removeDOMElement(paywall); + let art_match = window.location.pathname.match(/-(\d+)\.html$/); + if (art_match) { + let article_id = art_match[1]; + let article_sel = 'div[data-external-selector="body-elements"]'; + let article = document.querySelector(article_sel); + if (article) { + article.removeAttribute('class'); + let intro = article.querySelector('p[class][data-selector]'); + if (intro) { + let par_class = intro.className; + let url = window.location.href; + let url_src = 'https://fnetcore-api-prod.azurewebsites.net/api/v3/article?id=' + article_id; + getExtFetch(url_src, '', {}, main_faz); + function main_faz(url, data) { + try { + if (data && intro) { + let json_data = JSON.parse(data); + let pars = json_data.content_elements; + let parser = new DOMParser(); + let elem; + for (let par of pars) { + if (par.html) { + let doc = parser.parseFromString(par.html, 'text/html'); + let elem_type_match = par.html.match(/^<(\w+)/); + if (elem_type_match) { + let elem_type = elem_type_match[1]; + elem = doc.querySelector(elem_type); + if (elem_type !== 'iframe') + elem.className = par_class; + if (elem_type.match(/h\d/)) + elem.style = 'font-weight: bold;'; + } + } else if (par.image && par.image.url) { + elem = makeFigure(par.image.url, par.image.caption + ' ' + par.image.source); + elem.style = 'margin: 20px 0px;'; + } else if (!par.adItem && !par.articleIds && par.isBlurred) + console.log(par); + if (elem && intro.parentNode) + intro.parentNode.append(elem); + } + removeDOMElement(intro); + if (window.location.pathname.startsWith('/podcasts/')) { + let audio = document.querySelector('button[track-label="Podcast"]'); + if (audio && json_data.podcastAudioInfo && json_data.podcastAudioInfo.url) { + let audio_new = document.createElement('audio'); + audio_new.src = json_data.podcastAudioInfo.url; + audio_new.setAttribute('controls', ''); + audio.parentNode.replaceChild(audio_new, audio); + } + } else { + let audio = document.querySelector('button[track-label="TTS"]'); + if (audio && json_data.audioInfo && json_data.audioInfo.url) { + let audio_new = document.createElement('audio'); + audio_new.src = json_data.audioInfo.url; + audio_new.setAttribute('controls', ''); + audio.parentNode.replaceChild(audio_new, audio); + } + } + } + } catch (err) { + console.log(err); + } + } + } + } + } + } + let ads = 'div.lay-PaySocial, div.iqadtile_wrapper, div.iqdcontainer'; + hideDOMStyle(ads); +} + +else if (matchDomain('freitag.de')) { + let paywall = document.querySelector('section.qa-paywall'); + if (paywall) { + removeDOMElement(paywall); + let related = document.querySelector('div.c-teaser-plus-related--paywall'); + if (related) + related.classList.remove('c-teaser-plus-related--paywall'); + let article = document.querySelector('div.bo-article-text'); + if (article) { + let json_script = getArticleJsonScript(); + if (json_script) { + let json = JSON.parse(json_script.text); + if (json) { + let json_text = breakText_headers(json.articleBody); + let pars = json_text.split(/\n\n/g); + if (json_text) { + article.innerHTML = ''; + for (let par of pars) { + if (!par.startsWith('Placeholder ')) { + let par_new = document.createElement('p'); + par_new.innerText = par; + article.appendChild(par_new); + } + } + } + } + } else { + let hidden_article = document.querySelector('div.o-paywall'); + if (hidden_article) { + let par_first = true; + let pars = breakText_headers(hidden_article.innerText).split(/\n\n/g); + for (let par of pars) { + let par_new = document.createElement('p'); + let overlap = ''; + if (par_first) { + let intro = article.querySelectorAll('p'); + let intro_last = intro[intro.length - 1]; + par = par.trim(); + overlap = findOverlap(intro_last.innerText, par); + if (overlap) + intro_last.innerText = intro_last.innerText.replace(new RegExp(overlap + '$'), '') + par; + par_first = false; + } + if (!overlap && !par.startsWith('Placeholder ')) { + par_new.innerText = par; + article.appendChild(par_new); + } + } + } + } + } + } +} + +else if (matchDomain('handelsblatt.com')) { + let paywall = document.querySelector('app-paywall'); + if (paywall) { + removeDOMElement(paywall); + let article = document.querySelector('article'); + if (article) { + let url = window.location.href; + article.after(googleSearchToolLink(url)); + header_nofix('article', '', 'BPC > refresh page'); + } + } + window.localStorage.removeItem('HB.METERING'); + let overlay = document.querySelector('div[id^="sp_message_container_"]'); + removeDOMElement(overlay); + let noscroll = document.querySelector('html[class]'); + if (noscroll) + noscroll.removeAttribute('class'); +} + +else if (matchDomain('heise.de')) { + func_post = function () { + header_nofix('article', paywall_sel, 'BPC > no archive-fix'); + let dark_mode = document.querySelector('html.dark'); + if (dark_mode) + dark_mode.classList.remove('dark'); + if (mobile) { + document.querySelectorAll('figure img[loading="lazy"][style]').forEach(e => e.style = 'width: 95%;'); + } + } + let paywall_sel = 'a-gift:has(div.paywall-delimiter)'; + let url = window.location.href; + getArchive(url, paywall_sel, '', 'article'); + let ads = 'div.ad-ldb-container, div.inread-cls-reduc, aside.img-ad'; + hideDOMStyle(ads); +} + +else if (matchDomain('jacobin.de')) { + let paywall = pageContains('h3.m-auto', 'Dieser Artikel ist nur mit Abo zugänglich.'); + if (paywall.length) { + let slash = document.querySelector('div.slash'); + removeDOMElement(paywall[0].parentNode, slash); + let json_script = document.querySelector('script#__NEXT_DATA__'); + if (json_script) { + try { + let json = JSON.parse(json_script.text); + if (json && json.props.pageProps.sections && json.props.pageProps.sections[1].content) { + let url_next = json.query.slug; + if (url_next && !window.location.pathname.includes(url_next)) + refreshCurrentTab(); + let pars = json.props.pageProps.sections[1].content; + let first_par = document.querySelector('body > div#__next p.bodyText'); + if (first_par) { + let par_class = first_par.getAttribute('class'); + let article = first_par.parentNode; + if (article) { + let add_par = false; + for (let par of pars) { + if (!add_par) { + if (par.type === 'paywall') + add_par = true; + } else { + if (par.text) { + let elem_type = 'p'; + let elem_class = par_class; + let elem_style; + if (['paragraph', 'quote'].includes(par.type)) { + if (par.type === 'quote') + elem_style = 'font-size: 36px; font-weight: bold;'; + } else if (par.type === 'header') { + elem_type = 'h2'; + elem_class = 'content-element font-headline h2 my-1em'; + } + let content = par.text.replace(/ /g, ''); + let parser = new DOMParser(); + let content_new = parser.parseFromString('<' + elem_type + ' class="' + elem_class + (elem_style ? '" style="' + elem_style : '') + '">' + content + '', 'text/html'); + article.appendChild(content_new.querySelector(elem_type)); + } else + console.log(par); + } + } + let author_footer = article.querySelector('div.content-element > div > h3'); + if (author_footer) + article.appendChild(author_footer.parentNode.parentNode); + } + } + } + } catch (err) { + console.log(err); + } + } + } +} + +else if (matchDomain('krautreporter.de')) { + let paywall = document.querySelector('section.js-access-wall'); + if (paywall) { + removeDOMElement(paywall); + window.setTimeout(function () { + document.querySelectorAll('.blurred').forEach(e => e.classList.remove('blurred', 'json-ld-paywall-marker', 'hidden@print')); + }, 500); + let banners = 'div.js-paywall-divider, #steady-checkout'; + hideDOMStyle(banners); + } +} + +else if (domain = matchDomain(['ksta.de', 'rundschau-online.de'])) { + setCookie('anon_cookie', '', domain, '/', 0); + function unhide_article(node) { + removeDOMElement(node); + let article = document.querySelector('div[data-article-content][style]'); + if (article) + article.removeAttribute('style'); + } + waitDOMElement('div[data-type="paywall"]', 'DIV', unhide_article, true); + let banners = 'div.dm-slot, div.dm-zephr-banner'; + hideDOMStyle(banners); +} + +else if (matchDomain('kurier.at')) { + let paywall = document.querySelector('div#cfs-paywall-container'); + if (paywall) { + removeDOMElement(paywall); + let div_hidden = document.querySelector('div.paywall'); + if (div_hidden) { + div_hidden.classList.remove('paywall'); + div_hidden.removeAttribute('style'); + } + } + let ads = 'div[data-ad], div[data-outbrain]'; + hideDOMStyle(ads); +} + +else if (matchDomain(['mittelbayerische.de', 'pnp.de'])) { + let url = window.location.href; + getArchive(url, 'div.paywall-layer', '', 'div#article-body'); + let ads = 'div.d-sm-block'; + hideDOMStyle(ads); +} + +else if (matchDomain('motorradonline.de')) { + if (window.location.pathname.endsWith('/amp/')) + ampToHtml(); +} + +else if (matchDomain(['noz.de', 'shz.de'])) { + func_post = function () { + let podcasts = document.querySelectorAll('div > div[allow][old-src]'); + for (let elem of podcasts) { + let iframe = document.createElement('iframe'); + iframe.src = elem.getAttribute('old-src'); + iframe.style = 'width: 100%; height: 300px;'; + elem.parentNode.replaceChild(iframe, elem); + } + if (mobile) { + let lazy_images = document.querySelectorAll('div > figure > picture > img[loading="lazy"][style]'); + for (let elem of lazy_images) { + elem.style = 'width: 95%;'; + elem.parentNode.parentNode.parentNode.removeAttribute('style'); + } + } + } + let url = window.location.href; + getArchive(url, 'div.paywall', '', 'article'); + let ads = 'div.ad_label'; + hideDOMStyle(ads); +} + +else if (matchDomain('nw.de')) { + let paywall = document.querySelector('div[class*="paywall-overlay"]'); + if (paywall) { + paywall.removeAttribute('class'); + let json_script = getArticleJsonScript(); + if (json_script) { + try { + let json = JSON.parse(json_script.text); + let json_text = parseHtmlEntities(json.articleBody.replace(/\n/g, '\n\n').replace(/\.responsive[-@%{}()\.:;\w\s]+}\s?}/g, '')); + paywall.innerText = json_text; + } catch (err) { + console.log(err); + } + } + } +} + +else if (matchDomain('nwzonline.de')) { + let ads = 'div.adslot'; + hideDOMStyle(ads); +} + +else if (matchDomain(['nzz.ch', 'themarket.ch'])) { + let fade = document.querySelectorAll('.nzzinteraction'); + for (let elem of fade) + elem.classList.remove('nzzinteraction'); + let fade_new = document.querySelector('div.barrier'); + if (fade_new) + fade_new.removeAttribute('class'); + let ads = 'div.resor'; + hideDOMStyle(ads); +} + +else if (matchDomain('philomag.de')) { + let paywall = document.querySelector('div[id^="block-paywall"]'); + if (paywall) { + removeDOMElement(paywall); + let json_script = getArticleJsonScript(); + if (json_script) { + let json = JSON.parse(json_script.text); + if (json) { + let json_text = json.articlebody.replace(/%paywall%/g, '').replace(/(\\r)?\\n/g, '

'); + let content = document.querySelector('div.content-center > div.description'); + if (json_text && content) { + content.innerHTML = ''; + let article_new = document.createElement('p'); + article_new.innerText = json_text; + content.appendChild(article_new); + } + } + } + } +} + +else if (matchDomain('profil.at')) { + let paywall = document.querySelector('div.paywall'); + if (paywall) { + paywall.removeAttribute('class'); + paywall.removeAttribute('style'); + let fade = 'div#cfs-paywall-container'; + hideDOMStyle(fade); + } + let overlay = 'div.consentOverlay'; + hideDOMStyle(overlay, 2); +} + +else if (matchDomain('schweizermonat.ch')) { + getJsonUrl('div.entry-paywall-login', '', 'div.entry-main > div.entry__post-content'); +} + +else if (matchDomain('spektrum.de')) { + let paywall = document.querySelector('article.pw-premium'); + if (paywall) + paywall.classList.remove('pw-premium'); +} + +else if (matchDomain(['spiegel.de', 'manager-magazin.de'])) { + let url = window.location.href; + func_post = function () { + let failed_iframes = document.querySelectorAll('div > div[x-show="!iframeIsLoaded"]'); + for (let elem of failed_iframes) + hideDOMElement(elem.parentNode); + let body_dark = document.querySelector('body[class*="dark:"]'); + if (body_dark) + removeClassesByPrefix(body_dark, 'dark:'); + let charts = document.querySelectorAll('section div[x-data*="{isLoaded:"]'); + for (let elem of charts) + elem.style.height = elem.offsetHeight + 'px'; + if (mobile) { + let lazy_images = document.querySelectorAll('picture img[loading="lazy"][style]'); + for (let elem of lazy_images) + elem.style = 'width: 95%;'; + } + header_nofix('article', 'svg[id*="-plus-paywall-"]', 'BPC > no archive-fix'); + } + getArchive(url, 'div[data-area="paywall"]', '', 'article'); +} + +else if (matchDomain('springermedizin.de')) { + let paywall = document.querySelector('div#pay-wall'); + if (paywall) { + removeDOMElement(paywall); + let json_script = getArticleJsonScript(); + if (json_script) { + let json = JSON.parse(json_script.text); + if (json) { + let json_text = json.articleBody; + let article = document.querySelector('div > p.intro--paragraph'); + if (json_text && article) { + let article_new = document.createElement('p'); + article_new.innerText = json_text; + article.parentNode.replaceChild(article_new, article); + } + } + } + } +} + +else if (matchDomain('stern.de')) { + func_post = function () { + header_nofix(link_sel, paywall_sel, 'BPC > no archive-fix'); + if (mobile) { + let article = document.querySelector(article_src_sel); + if (article) { + let lazy_images = article.querySelectorAll('figure > img[loading="lazy"][style]'); + for (let elem of lazy_images) { + elem.style = 'width: 95%;'; + elem.parentNode.style = 'margin-bottom: 20px'; + let caption = elem.parentNode.querySelector('figcaption'); + if (caption) + caption.style = 'width: 95%;'; + } + let article_recs = article.querySelectorAll('article'); + for (let elem of article_recs) + elem.style = 'width: 95%;'; + let article_opulent = document.querySelector('div.page-opulent__body-inner > div > div'); + if (article_opulent) + article_opulent.removeAttribute('style'); + } + } + let charts = document.querySelectorAll('ws-socialwidget > slot > slot[slot="content"]'); + for (let chart of charts) { + if (chart.innerText.includes('src="')) { + let chart_url = chart.innerText.split('src="')[1].split('"')[0]; + let iframe = document.createElement('iframe'); + iframe.src = chart_url; + iframe.style = "width: 100%; height: 600px; border: none;"; + let container = chart.parentNode.parentNode; + container.parentNode.replaceChild(iframe, container); + } + } + } + let paywall_sel = 'ws-paywall'; + let article_sel = 'div.article__body'; + let article_src_sel = 'main > article > div:last-child'; + let link_sel = 'div.page__content-inner, div.page-opulent'; + let url = window.location.href; + getArchive(url, paywall_sel, '', article_sel, '', article_src_sel, link_sel); +} + +else if (matchDomain('sueddeutsche.de')) { + let url = window.location.href; + if (matchDomain('sz-magazin.sueddeutsche.de')) { + func_post = function () { + header_nofix('main', 'div#sz-paywall', 'BPC > no archive-fix'); + } + getArchive(url, 'div.articlemain__inner--reduced', {rm_class: 'articlemain__inner--reduced'}, 'main'); + } else if (window.location.pathname.startsWith('/projekte/artikel/')) { + func_post = function () { + let lazy_images = document.querySelectorAll('img[loading="lazy"][style*="min-width:"]'); + for (let elem of lazy_images) + elem.style = 'width: 80%; margin: auto;'; + let sticky = document.querySelectorAll('div > div > div[old-position="sticky"]'); + for (let elem of sticky) { + let div_hidden = elem.parentNode.parentNode.querySelector('div[style^="display:none;"]'); + if (div_hidden) + div_hidden.removeAttribute('style'); + removeDOMElement(elem.parentNode); + } + if (intro) { + let intro_old = document.querySelector(intro_sel); + if (intro_old && intro_old.parentNode) + intro_old.parentNode.replaceChild(intro, intro_old); + } + header_nofix('main', 'div#sz-paywall', 'BPC > no archive-fix'); + } + let intro_sel = 'section#module-0'; + let intro = document.querySelector(intro_sel); + getArchive(url, 'div.offer-page', '', 'main'); + } else { + let paywall = document.querySelector('head > meta[content="locked"]'); + if (paywall) { + removeDOMElement(paywall); + let article_sel = 'div[itemprop="articleBody"]'; + let article = document.querySelector(article_sel); + if (article) { + let json_script = document.querySelector('script[data-hydration-props-component-name="ArticleBodyDDRum"]'); + if (json_script) { + try { + let json = JSON.parse(decodeURIComponent(json_script.text)); + if (json) { + let pars = json.uiArticleContent; + if (pars.length) { + article.innerHTML = ''; + addStyle(article_sel + ' p {margin-bottom: 32px;}'); + } + let parser = new DOMParser(); + for (let par of pars) { + let elem = document.createElement('p'); + if (['paragraph', 'datawrapper', 'youtube'].includes(par.component)) { + if (par.content && par.content.html) { + let elem_type = par.content.html.startsWith('
') ? 'div' : 'p'; + let content_new = parser.parseFromString('<' + elem_type + '>' + parseHtmlEntities(par.content.html) + '', 'text/html'); + let iframe = content_new.querySelector('iframe'); + if (iframe) { + iframe.style = 'width: 100%; margin-bottom: 32px;'; + if (!iframe.height) + iframe.height = '400px'; + } + elem = content_new.querySelector(elem_type); + } + } else if (par.component === 'ercms') { + if (par.content && par.content.url) { + elem = document.createElement('div'); + let iframe = document.createElement('iframe'); + iframe.src = par.content.url; + iframe.style = 'width: 100%; height: 400px; margin-bottom: 32px;'; + elem.appendChild(iframe); + } + } else if (par.component === 'subheading') { + if (par.content && par.content.text) { + elem.innerText = par.content.text; + elem.style = 'font-weight: bold;'; + } + } else if (par.component === 'image') { + if (par.image) { + let caption = par.caption ? par.caption.html + ' (Foto: ' + par.imageSource + ')' : ''; + let sub_elem = makeFigure(par.image.url, caption); + elem.appendChild(sub_elem); + } + } else if (!(['articleHeader', 'articleTeaserM', 'newsletterEmbed'].includes(par.component) || par.component.startsWith('iqadtile'))) + console.log(par); + if (elem.hasChildNodes()) + article.appendChild(elem); + } + } + } catch (err) { + console.log(err); + } + } + } + } + } + let ads = 'er-ad-slot, div.iqdcontainer'; + hideDOMStyle(ads); +} + +else if (matchDomain('suedkurier.de')) { + func_post = function () { + let article = document.querySelector(article_sel); + if (article) { + let pars = article.querySelectorAll('section > div > div[style^="box-sizing:"]'); + if (pars && pars.length < 3) + header_nofix(article_sel, '', 'BPC > no archive-fix'); + } + } + let url = window.location.href; + let article_sel = 'main > article'; + getArchive(url, 'aside.article-paywall', '', article_sel); +} + +else if (matchDomain('t3n.de')) { + let paywall = document.querySelector('div.c-paywall__wrapper'); + if (paywall) { + removeDOMElement(paywall); + let json_script = getArticleJsonScript(); + if (json_script) { + let json = JSON.parse(json_script.text); + if (json) { + let json_text = json.articleBody; + if (json_text.includes('[embed]')) + json_text = json_text.replace(/\[embed\]([^\[]+)\[\/embed\]/g, '$1\n'); + json_text = json_text.replace(/\[[^\]]+\]/g, ''); + let article = document.querySelector('div.paywall-blur > p'); + if (json_text && article) { + article.innerText = parseHtmlEntities(json_text); + article.parentNode.removeAttribute('class'); + } + } + } + } +} + +else if (matchDomain('tagesspiegel.de')) { + let paywall_sel = 'div#paywall'; + let url = window.location.href; + if (matchDomain('www.tagesspiegel.de')) { + func_post = function () { + for (let elem of videos) { + let iframe = document.createElement('iframe'); + iframe.src = elem.getAttribute('old-src'); + iframe.style = 'width: 100%; height: 400px;'; + elem.parentNode.replaceChild(iframe, elem); + } + let opinionary = document.querySelector('div > div#opinary-automation-placeholder'); + if (opinionary) + hideDOMElement(opinionary.parentNode); + if (mobile) { + let lazy_images = document.querySelectorAll('figure img[loading="lazy"][style]'); + for (let elem of lazy_images) + elem.style = 'width: 95%;'; + } + } + getArchive(url, paywall_sel, '', 'div#story-elements'); + } else if (matchDomain('interaktiv.tagesspiegel.de')) { + let paywall = document.querySelector(paywall_sel); + if (paywall) { + removeDOMElement(paywall); + let article = document.querySelector('div.tslr-article > p'); + if (article) + article.firstChild.before(archiveLink(url)); + } + } + let ads = 'div.iqdcontainer'; + hideDOMStyle(ads); +} + +else if (matchDomain('vn.at')) { + if (window.location.href.match(/\.vn\.at\/.+\/\d{4}\//)) { + let paywall = document.querySelector('div.paywalled-content'); + if (paywall) { + let par = paywall.querySelector('p'); + if (!par) { + refreshCurrentTab(); + } else { + let lazy_images = document.querySelectorAll('img[src^="data:image/"][lazy-src]'); + for (let elem of lazy_images) { + elem.src = elem.getAttribute('lazy-src'); + } + } + } else + refreshCurrentTab(); + } +} + +else if (matchDomain('vol.at')) { + if (!window.location.pathname.match(/\/amp\/?$/)) { + window.setTimeout(function () { + let paywall = document.querySelector('div.vodl-region-article__premium-content'); + if (paywall) { + paywall.removeAttribute('class'); + if (!paywall.hasChildNodes()) { + let json_script = document.querySelector('script#externalPostDataNode'); + if (json_script) { + try { + let json = JSON.parse(json_script.text); + let json_text = json.content.data.post.content; + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + json_text + '
', 'text/html'); + let article_new = doc.querySelector('div'); + let hidden_images = article_new.querySelectorAll('img[src^="/"][srcset]'); + let json_domain = json.content.data.post.thumbnail.src.match(/https:\/\/(www\.)?\w+\.at/)[0]; + for (let elem of hidden_images) { + elem.src = elem.src.replace('https://www.vol.at', json_domain); + elem.removeAttribute('srcset'); + } + let hidden_comments = document.querySelector('div[class*="backdrop-blur"]'); + if (hidden_comments) + hidden_comments.removeAttribute('class'); + let article = document.querySelector('div.article-body'); + if (article) { + article.innerHTML = ''; + article.appendChild(article_new); + } + } catch (err) { + console.log(err); + } + } + } + } + }, 500); + let ads = 'div[id^="rm-adslot-"], div[id^="piano_rec"]'; + hideDOMStyle(ads); + } else + ampToHtml(); +} + +else if (matchDomain('weltkunst.de')) { + let paywall = document.querySelector('section.paywall'); + if (paywall) { + removeDOMElement(paywall); + let json_url_dom = document.querySelector('head > link[rel="alternate"][type="application/json"][href]'); + if (json_url_dom) { + let json_url = json_url_dom.href; + fetch(json_url) + .then(response => { + if (response.ok) { + response.json().then(json => { + let json_text = json.content.rendered; + let content = document.querySelector('div.article div.text'); + if (json_text) { + if (content) { + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + json_text + '
', 'text/html'); + let content_new = doc.querySelector('div'); + content.innerHTML = ''; + content.appendChild(content_new); + } + } else + header_nofix(content); + }); + } + }); + } + } + let par_initial = document.querySelector('p.initial'); + removeDOMElement(par_initial); +} + +else if (matchDomain('welt.de')) { + func_post = function () { + if (mobile) { + let headers = document.querySelectorAll('main header, main header ~ div'); + for (let elem of headers) + elem.removeAttribute('style'); + let main_divs = document.querySelectorAll('main div[style] > div > div[id]'); + for (let elem of main_divs) { + if (elem.querySelector('img')) + elem.parentNode.parentNode.removeAttribute('style'); + } + let lazy_images = document.querySelectorAll('main img[loading="lazy"][style]'); + for (let elem of lazy_images) + elem.style = 'width: 95%;'; + } + header_nofix('main header', 'img[alt^="WELTplus"][loading]', 'BPC > no archive-fix'); + let ads = pageContains('span', 'Anzeige'); + removeDOMElement(...ads); + } + let url = window.location.href; + getArchive(url, 'div.contains_walled_content, div.c-article-paywall', '', 'main header + div'); + let ads = 'div[data-component="Outbrain"], div[class*="c-ad"]'; + hideDOMStyle(ads); +} + +else if (matchDomain('weser-kurier.de')) { + let ads = 'div.ad-wrapper, div.anyad, div.msn-ads'; + hideDOMStyle(ads); +} + +else if (matchDomain('wiwo.de')) { + window.setTimeout(function () { + let paywall = document.querySelector('app-paywall'); + if (paywall) { + removeDOMElement(paywall); + let article = document.querySelector('app-blind-text'); + if (article) { + let url = window.location.href; + article.before(googleSearchToolLink(url)); + let json_script = getArticleJsonScript(); + if (json_script) { + let json = JSON.parse(json_script.text); + if (json) { + let json_text = json.find(x => x.articleBody).articleBody; + let article_new = document.createElement('div'); + article_new.innerText = json_text.replace(/[\r\n]/g, '\r\n\r\n'); + article_new.style = 'margin: 20px;'; + article.parentNode.replaceChild(article_new, article); + } + } + } + } + }, 2000); + let ads = 'div.iqadtile'; + hideDOMStyle(ads); +} + +else if (matchDomain('zeit.de')) { + let header_sel = 'article > header'; + let header = document.querySelector(header_sel); + func_post = function () { + if (header) { + let header_new = document.querySelector(header_sel); + if (header_new) + header_new.parentNode.replaceChild(header, header_new); + } + let comments_link = document.querySelector('div[style*="align-items"] a[href$="#comments"]'); + if (comments_link) + comments_link.href = '#comments'; + document.querySelectorAll('div[style*="padding-bottom:"]:has(figure), div[style*="grid-template-columns:"]:has(figure)').forEach(e => e.removeAttribute('style')); + let gst_link = false; + let figures = document.querySelectorAll('figure:has(img[loading="lazy"][style])'); + for (let figure of figures) { + let lazy_image = figure.querySelector('img'); + if (lazy_image.src.startsWith('data:image/')) { + let json_script = figure.querySelector('script[type="application/ld+json"]:not(:empty)'); + if (json_script && json_script.text.match(/"url":\s?"/)) { + let img_url = json_script.text.split(/"url":\s?"/)[1].split('",')[0]; + if (!img_url.includes('.zeit.de/newsletter/')) { + lazy_image.src = img_url; + lazy_image.style = 'width: 95%;'; + figure.removeAttribute('style'); + } + } else if (!gst_link && !figure.querySelector('figcaption[style*="display:none;"]')) { + gst_link = true; + header.append(googleSearchToolLink(url)); + header_nofix('div#bpc_archive', '', 'BPC > no images (see GST-link)'); + } + } else + lazy_image.style = 'width: 95%;'; + } + let videos = document.querySelectorAll('div > div[allowfullscreen][old-src]'); + for (let elem of videos) { + let iframe = document.createElement('iframe'); + iframe.src = elem.getAttribute('old-src'); + iframe.style = 'width: 100%; height: 400px;'; + elem.parentNode.replaceChild(iframe, elem); + } + let charts = document.querySelectorAll('div > div[id^="datawrapper-chart-"][old-src]'); + for (let elem of charts) { + let iframe = document.createElement('iframe'); + iframe.src = elem.getAttribute('old-src'); + iframe.style = 'width: 100%; height: 400px; border: none;'; + elem.parentNode.replaceChild(iframe, elem); + } + if (mobile) { + let span_empty = document.querySelectorAll('span:empty'); + removeDOMElement(...span_empty); + } + let ads = 'div[style*=";min-height:"]:has( > div[id^="iqadtile"])'; + hideDOMStyle(ads, 2); + } + let url = window.location.href.split(/[#\?]/)[0]; + if (document.querySelector('head > link[rel="next"]')) + url += '/komplettansicht'; + getArchive(url, 'aside#paywall', '', 'main', '', 'main', 'article > div'); + let ads = 'div[id^="iqadtile"], .iqdcontainer'; + hideDOMStyle(ads); +} + +else if (matchDomain(de_funke_medien_domains)) { + let paywall = document.querySelector('div#paywall-container'); + if (paywall) { + removeDOMElement(paywall); + let spark_script = document.querySelector('script#__SPARK__'); + if (spark_script) { + let match = spark_script.text.match(/PUBLICATION:\s?'([\w-]+)',/); + if (match) { + func_post = function () { + document.querySelectorAll('div[data-carousel-id-slider]').forEach(x => x.removeAttribute('class')); + let embed_templates = document.querySelectorAll('div[data-embed-id] > template[data-embedbox-id-embed-template]'); + for (let elem of embed_templates) { + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + elem.innerHTML + '
', 'text/html'); + let blockquote = doc.querySelector('div'); + elem.parentNode.before(blockquote); + removeDOMElement(elem.parentNode); + } + let charts = document.querySelectorAll('aside > div[id^="datawrapper-vis-"]'); + for (let elem of charts) { + let img = elem.querySelector('noscript > img[src]'); + if (img) { + elem.parentNode.before(img); + removeDOMElement(elem.parentNode); + } + } + } + let spark_domain = match[1]; + let url_src = 'https://app-webview.sparknews.funkemedien.de/' + spark_domain + window.location.pathname; + fetch_headers = {"Authorization": "Basic YXBpOkNTeGxxRG1YM2xCTmRsS1l6allRcWZqTnFZMkhQVUVm"}; + replaceDomElementExt(url_src, true, false, 'div.article-body', 'BPC > no fix (source file)'); + } + } + } + let ads = 'aside.ad-slot-wrapper'; + hideDOMStyle(ads); +} + +else if (matchDomain(de_lv_domains)) { + let paywall = document.querySelector('div[id^="paymentprocess-"]'); + if (paywall) { + let intro = document.querySelector('div.m-paywall__textFadeOut'); + removeDOMElement(paywall, intro); + let div_hidden = document.querySelector('div.paywall-full-content[style]'); + if (div_hidden) { + div_hidden.removeAttribute('class'); + div_hidden.removeAttribute('style'); + } + } + let ads = 'div.adZone'; + hideDOMStyle(ads); +} + +else if (matchDomain(de_motor_presse_domains)) { + let ads = 'div#ads-container, div.va-sponsored, div.mps_markAd'; + hideDOMStyle(ads); +} + +else if (matchDomain(de_rp_medien_domains)) { + func_post = function () { + header_nofix('article', 'div#park-paywall', 'BPC > no archive-fix'); + let videos = 'glomex-player'; + hideDOMStyle(videos, 5); + } + let url = window.location.href; + getArchive(url, 'div.park-paywall-content', '', 'article'); + let ads = 'div.portal-slot'; + hideDOMStyle(ads); +} + +else if (matchDomain(de_madsack_domains) || document.querySelector('head > link[href*=".rndtech.de/"]')) { + if (!window.location.search.includes('outputType=valid_amp')) { + let ads = 'div[class^="Adstyled__AdWrapper"]'; + hideDOMStyle(ads); + } else { + ampToHtml(); + } +} + +else if (matchDomain(de_smn_domains) || matchDomain(de_smn_custom_domains)) { + if (matchDomain(de_smn_domains)) { + let restricted = document.querySelector('div.restricted-area'); + if (restricted) + restricted.classList.remove('restricted-area'); + } else { + func_post = function () { + if (mobile) { + document.querySelectorAll('figure > img[loading="lazy"][style]').forEach(e => e.style = 'width: 95%;'); + } + } + let url = window.location.href; + getArchive(url, 'div.mod-paywall, div.upscore-paywall-placeholder', '', 'article, div#article-container'); + } + let ads = 'div.mod-paywall, div.Billboard, div[id*="board"], div.ad, div[id^="traffective-ad-"], div.glomex'; + hideDOMStyle(ads); +} + +else if (matchDomain(de_ippen_media_domains) || document.querySelector('header a[href^="https://www.ippen.media"]')) { + let ads = 'div[class^="id-TBeepSlot-"], div[data-id-advertdfpconf]'; + hideDOMStyle(ads); +} + +else if (matchDomain(de_vrm_domains) || matchDomain(de_vrm_custom_domains)) { + func_post = function () { + let article = document.querySelector(article_sel); + if (article) { + article.querySelectorAll('div > div[role="button"]').forEach(e => removeDOMElement(e.parentNode)); + if (mobile) { + let pictures = document.querySelectorAll('picture > img[style]'); + for (let elem of pictures) { + elem.style = 'width: 95%; margin: 10px;'; + elem.parentNode.removeAttribute('style'); + } + } + } + } + let article_sel = 'article section'; + let url = window.location.href; + window.setTimeout(function () { + getArchive(url, 'div.--blurredContent', {rm_attrib: 'class'}, article_sel); + }, 1000); + let ads = 'div.adSlot, div.loadingBanner'; + hideDOMStyle(ads); +} + +ads_hide(); +leaky_paywall_unhide(); + +}, 1000); + +// General Functions + +// import (see @require) + +function breakText_headers(str) { + str = breakText(str, true); + // exceptions: names with alternating lower/uppercase (no general fix) + let str_rep_arr = ['AstraZeneca', 'BaFin', 'BerlHG', 'BfArM', 'BilMoG', 'BioNTech', 'ChatGPT', 'DiGA', 'EuGH', 'FinTechRat', 'GlaxoSmithKline', 'IfSG', 'medRxiv', 'mmHg', 'OpenAI', 'PlosOne', 'StVO', 'TikTok']; + let str_rep_split; + let 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; +} + +})(); diff --git a/userscript/bpc.en.user.js b/userscript/bpc.en.user.js new file mode 100644 index 0000000..e9b5c4d --- /dev/null +++ b/userscript/bpc.en.user.js @@ -0,0 +1,5149 @@ +// ==UserScript== +// @name Bypass Paywalls Clean - en +// @version 4.2.5.0 +// @description Bypass Paywalls of news sites +// @author magnolia1234 +// @downloadURL https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters/blob/raw?file=userscript/bpc.en.user.js +// @updateURL https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters/blob/raw?file=userscript/bpc.en.user.js +// @homepageURL https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters +// @supportURL https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters +// @license MIT; https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters/blob/raw?file=LICENSE +// @match *://*.com/* +// @match *://*.co.uk/* +// @match *://*.com.au/* +// @match *://*.co/* +// @match *://*.io/* +// @match *://*.net/* +// @match *://*.net.au/* +// @match *://*.org/* +// @match *://*.pub/* +// @match *://*.businessdesk.co.nz/* +// @match *://*.businesspost.ie/* +// @match *://*.businesstimes.com.sg/* +// @match *://*.capital.bg/* +// @match *://*.dnevnik.bg/* +// @match *://*.epoch.org.il/* +// @match *://*.europower.no/* +// @match *://*.fiskeribladet.no/* +// @match *://*.forbes.ua/* +// @match *://*.ftm.eu/* +// @match *://*.gitflic.ru/* +// @match *://*.haaretz.co.il/* +// @match *://*.iai.tv/* +// @match *://*.independent.ie/* +// @match *://*.indiatoday.in/* +// @match *://*.intrafish.no/* +// @match *://*.ipolitics.ca/* +// @match *://*.japantimes.co.jp/* +// @match *://*.livelaw.in/* +// @match *://*.nation.africa/* +// @match *://*.nautil.us/* +// @match *://*.niagarafallsreview.ca/* +// @match *://*.nv.ua/* +// @match *://*.nzherald.co.nz/* +// @match *://*.puck.news/* +// @match *://*.sloanreview.mit.edu/* +// @match *://*.stcatharinesstandard.ca/* +// @match *://*.theleaflet.in/* +// @match *://*.uxdesign.cc/* +// @match *://*.wellandtribune.ca/* +// @connect archive.fo +// @connect archive.is +// @connect archive.li +// @connect archive.md +// @connect archive.ph +// @connect archive.vn +// @connect djservices.io +// @exclude *://*.amazon-adsystem.com/* +// @exclude *://*.consentmanager.net/* +// @exclude *://*.centrefrance.com/* +// @exclude *://*.criteo.com/* +// @exclude *://*.dailymotion.com/* +// @exclude *://*.doubleclick.net/* +// @exclude *://*.dwcdn.net/* +// @exclude *://*.facebook.com/* +// @exclude *://*.google.com/* +// @exclude *://*.googleapis.com/* +// @exclude *://*.googletagmanager.com/* +// @exclude *://*.instagram.com/* +// @exclude *://*.klarna.com/* +// @exclude *://*.mediafire.com/* +// @exclude *://*.openx.net/* +// @exclude *://*.outbrain.com/* +// @exclude *://*.pinterest.com/* +// @exclude *://*.pubmatic.com/* +// @exclude *://*.rubiconproject.com/* +// @exclude *://*.seedtag.com/* +// @exclude *://*.smartadserver.com/* +// @exclude *://*.stripe.com/* +// @exclude *://*.taboola.com/* +// @exclude *://*.tinypass.com/* +// @exclude *://*.twitter.com/* +// @exclude *://*.ultimedia.com/* +// @exclude *://*.youtube.com/* +// @exclude *://*.abcmais.com/* +// @exclude *://*.bienpublic.com/* +// @exclude *://*.cambiocolombia.com/* +// @exclude *://*.clarin.com/* +// @exclude *://*.connaissancedesarts.com/* +// @exclude *://*.cronista.com/* +// @exclude *://*.diariocordoba.com/* +// @exclude *://*.diariovasco.com/* +// @exclude *://*.elconfidencial.com/* +// @exclude *://*.elcorreo.com/* +// @exclude *://*.elespanol.com/* +// @exclude *://*.elespectador.com/* +// @exclude *://*.elmercurio.com/* +// @exclude *://*.elpais.com/* +// @exclude *://elpais.com/* +// @exclude *://*.elperiodico.com/* +// @exclude *://*.elperiodicodearagon.com/* +// @exclude *://*.elperiodicoextremadura.com/* +// @exclude *://*.elperiodicomediterraneo.com/* +// @exclude *://*.eltiempo.com/* +// @exclude *://*.eltribuno.com/* +// @exclude *://*.eluniverso.com/* +// @exclude *://*.exame.com/* +// @exclude *://*.expansion.com/* +// @exclude *://*.faz.net/* +// @exclude *://*.globo.com/* +// @exclude *://*.handelsblatt.com/* +// @exclude *://*.ilsole24ore.com/* +// @exclude *://*.jeuneafrique.com/* +// @exclude *://*.journaldunet.com/* +// @exclude *://*.larioja.com/* +// @exclude *://*.lasegunda.com/* +// @exclude *://*.latercera.com/* +// @exclude *://*.lavenir.net/* +// @exclude *://*.ledauphine.com/* +// @exclude *://*.ledevoir.com/* +// @exclude *://*.lejsl.com/* +// @exclude *://*.lerevenu.com/* +// @exclude *://*.lesinrocks.com/* +// @exclude *://*.levante-emv.com/* +// @exclude *://*.loeildelaphotographie.com/* +// @exclude *://*.marca.com/* +// @exclude *://*.marianne.net/* +// @exclude *://*.parismatch.com/* +// @exclude *://*.parkiet.com/* +// @exclude *://*.politicaexterior.com/* +// @exclude *://*.pourleco.com/* +// @exclude *://*.projectcargojournal.com/* +// @exclude *://*.quotidiano.net/* +// @exclude *://*.railfreight.cn/* +// @exclude *://*.railfreight.com/* +// @exclude *://*.railtech.com/* +// @exclude *://*.reforme.net/* +// @exclude *://*.revistaoeste.com/* +// @exclude *://*.science-et-vie.com/* +// @exclude *://*.topagrar.com/* +// @exclude *://*.tt.com/* +// @exclude *://*.tuttosport.com/* +// @exclude *://*.valeursactuelles.com/* +// @exclude *://*.wochenblatt.com/* +// @grant GM.xmlHttpRequest +// @require https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters/blob/raw?file=userscript/bpc_func.js +// ==/UserScript== + +(function() { + //'use strict'; + +if (window.top !== window.self && !matchDomain(['app.historytoday.com', 'appan.newscientist.com'])) + return; + +var usa_adv_local_domains = ['al.com', 'cleveland.com', 'lehighvalleylive.com', 'masslive.com', 'mlive.com', 'nj.com', 'oregonlive.com', 'pennlive.com', 'silive.com', 'syracuse.com']; + +if (matchDomain(['adage.com', 'autonews.com', 'pionline.com'])) { + function crain_main() { + if (window.Fusion) { + window.Fusion.globalContent._id = 0; + window.Fusion.globalContent.content_restrictions = {}; + } + } + window.setTimeout(function () { + insert_script(crain_main); + }, 100); +} + +else if (matchDomain('nzherald.co.nz')) { + function nzherald_main() { + if (window.Fusion) + window.Fusion.globalContent.isPremium = false; + } + window.setTimeout(function () { + insert_script(nzherald_main); + }, 100); +} + +else if (matchDomain(['thehindu.com', 'thehindubusinessline.com'])) { + function hindu_main() { + if (window) { + window.Adblock = false; + window.isNonSubcribed = false; + } + } + window.setTimeout(function () { + insert_script(hindu_main); + }, 100); +} + +else if (matchDomain(usa_adv_local_domains)) { + function adv_main() { + if (window.adiData) { + window.adiData.entryTags = 0; + } + } + window.setTimeout(function () { + insert_script(adv_main); + }, 100); +} + +window.setTimeout(function () { + +var ca_torstar_domains = ['niagarafallsreview.ca', 'stcatharinesstandard.ca', 'thepeterboroughexaminer.com', 'therecord.com', 'thespec.com', 'thestar.com', 'wellandtribune.ca']; +var ke_nation_media_domains = ['businessdailyafrica.com', 'nation.africa']; +var medium_custom_domains = ['betterprogramming.pub', 'towardsdatascience.com']; +var no_dn_media_domains = ['dn.no', 'europower.no', 'fiskeribladet.no', 'hydrogeninsight.com', 'intrafish.com', 'intrafish.no', 'kystens.no', 'rechargenews.com', 'tradewindsnews.com', 'upstreamonline.com']; +var sg_sph_media_domains = ['businesstimes.com.sg', 'straitstimes.com']; +var uk_dmg_media_domains = ['dailymail.co.uk', 'mailonsunday.co.uk', 'thisismoney.co.uk']; +var uk_nat_world_domains = ['scotsman.com', 'yorkshirepost.co.uk']; +var usa_arizent_custom_domains = ['accountingtoday.com', 'benefitnews.com', 'bondbuyer.com', 'dig-in.com', 'financial-planning.com', 'nationalmortgagenews.com']; +var usa_conde_nast_domains = ['architecturaldigest.com', 'bonappetit.com', 'cntraveler.com', 'epicurious.com', 'gq.com' , 'newyorker.com', 'vanityfair.com', 'vogue.co.uk', 'vogue.com', 'wired.com']; +var usa_craincomm_domains = ['360dx.com', 'adage.com', 'autonews.com', 'chicagobusiness.com', 'crainscleveland.com', 'crainsdetroit.com', 'crainsgrandrapids.com', 'crainsnewyork.com', 'european-rubber-journal.com', 'genomeweb.com', 'modernhealthcare.com', 'pionline.com', 'plasticsnews.com', 'precisionmedicineonline.com', 'rubbernews.com', 'sustainableplastics.com', 'tirebusiness.com', 'utech-polyurethane.com']; +var usa_gannett_domains = ['azcentral.com', 'cincinnati.com', 'commercialappeal.com', 'courier-journal.com', 'democratandchronicle.com', 'desmoinesregister.com', 'detroitnews.com', 'dispatch.com', 'freep.com', 'indystar.com', 'jacksonville.com', 'jsonline.com', 'knoxnews.com', 'news-press.com', 'northjersey.com', 'oklahoman.com', 'palmbeachpost.com', 'tennessean.com']; +var usa_hearst_comm_domains = ['ctpost.com', 'expressnews.com', 'houstonchronicle.com', 'nhregister.com', 'sfchronicle.com', 'statesman.com', 'timesunion.com']; +var usa_lee_ent_domains = ['buffalonews.com', 'journalnow.com', 'journalstar.com', 'madison.com', 'nwitimes.com', 'omaha.com', 'richmond.com', 'stltoday.com', 'tucson.com', 'tulsaworld.com']; +var usa_mcc_domains = ['bnd.com', 'charlotteobserver.com', 'elnuevoherald.com', 'fresnobee.com', 'kansas.com', 'kansascity.com', 'kentucky.com', 'mcclatchydc.com', 'miamiherald.com', 'newsobserver.com', 'sacbee.com', 'star-telegram.com', 'thestate.com', 'tri-cityherald.com']; +var usa_mng_domains = ['bostonherald.com', 'denverpost.com', 'eastbaytimes.com', 'mercurynews.com', 'ocregister.com', 'pressenterprise.com', 'sandiegouniontribune.com', 'twincities.com']; +var usa_nymag_domains = ['curbed.com', 'grubstreet.com', 'nymag.com', 'thecut.com', 'vulture.com']; +var usa_outside_mag_domains = ["backpacker.com", "betamtb.com", "betternutrition.com", "cleaneatingmag.com", "climbing.com", "outsideonline.com", "oxygenmag.com", "skimag.com", "trailrunnermag.com", "triathlete.com", "vegetariantimes.com", "womensrunning.com", "yogajournal.com"]; +var usa_penske_media_domains = ['billboard.com', 'rollingstone.com', 'sourcingjournal.com', 'sportico.com', 'variety.com', 'wwd.com']; +var usa_tribune_domains = ['baltimoresun.com', 'capitalgazette.com', 'chicagotribune.com', 'courant.com', 'dailypress.com', 'mcall.com', 'nydailynews.com', 'orlandosentinel.com', 'pilotonline.com', 'sun-sentinel.com']; + +if (matchDomain('gitflic.ru')) { + if (window.location.pathname.startsWith('/project/magnolia1234/bpc_uploads') && document.head) { + let sheet = document.createElement('style'); + let path_short = window.location.pathname.replace('/project/magnolia1234/bpc_uploads', ''); + if (!path_short) + sheet.innerText = 'div[data-cell-type="commit"], div[data-cell-type="date"] {display: none !important;} div[data-cell-type="filename"] {flex: 0 0 100% !important;}'; + else if (path_short.match(/^\/(blob|file)/)) + sheet.innerText = 'div.project-files-tree, div.project-files-list {flex: 0 0 50% !important; max-width: 50% !important;}'; + if (sheet.innerText) + document.head.appendChild(sheet); + } +} + +if (matchDomain('medium.com') || matchDomain(medium_custom_domains) || document.querySelector('head > link[href*=".medium.com/"]')) { + let url = window.location.href; + let paywall = document.querySelector('article.meteredContent'); + if (paywall) { + paywall.removeAttribute('class'); + let header = paywall.querySelector('h1'); + if (header) + header.before(externalLink(['freedium.cfd', 'freedium-mirror.cfd', 'readmedium.com', 'archive.today'], 'https://{domain}/{url}', url, 'BPC > Try for full article text:')); + } + window.setTimeout(function () { + let banner = pageContains('div > div > p', /author made this story available to/); + if (banner.length) + removeDOMElement(banner[0].parentNode.parentNode); + }, 1000); +} + +else if (window.location.hostname.match(/\.(au|nz)$/) || matchDomain(['afr.com'])) {//australia & new zealand + +if (matchDomain('afr.com')) { + let error = document.querySelector('div[data-testid="DefaultError"]'); + if (error) + refreshCurrentTab(); + let article_sel = '#endOfArticle:not(:empty)'; + let article = document.querySelector(article_sel); + if (!article) { + article_sel = '#body-content'; + article = document.querySelector(article_sel); + } + if (article) { + window.setTimeout(function () { + let pars = article.querySelectorAll('p:not([class]), p[class*="-defaultWrapper"], figure:not(:empty)'); + let pagination = document.querySelector('div > span#pagination-top'); + if ((pars.length && pars.length < 5) || pagination) { + if (pagination) { + removeDOMElement(pagination.parentNode); + } else { + let loading = pageContains(article_sel + ' div', 'Loading...'); + removeDOMElement(...pars, ...loading); + } + let url = window.location.href.split(/[#\?]/)[0]; + fetch(url) + .then(response => { + if (response.ok) { + response.text().then(html => { + if (html.includes('__REDUX_STATE__=')) { + try { + let json = JSON.parse(html.split('__REDUX_STATE__=')[1].split('};')[0].replace(/:undefined([,}])/g, ':0$1').replace(/new\sMap\(\[[^{]*\]\)/g, 0) + '}'); + if (json) { + let placeholders; + function find_item(match, p1, offset, string) { + let placeholder_id = p1; + let result = ''; + if (placeholder_id && placeholders[placeholder_id]) { + let item = placeholders[placeholder_id]; + if (item.data) { + if (['linkArticle', 'linkExternal'].includes(item.type)) { + if (item.data.text) { + if (item.data.url) + result = '' + item.data.text + ''; + else + result = item.data.text; + } + } else if (item.type === 'image') { + if (item.data.fileName) { + let credit = (item.data.credit && item.data.credit.trim()) || item.data.source; + result = '
' + (item.data.caption ? item.data.caption : '') + (credit ? ' ' + credit + '' : '') + '
'; + } + } else if (item.type === 'youtube') { + if (item.data.url) { + if (item.data.url.includes('watch?v=')) + result = ''; + else + result = '' + item.data.url + ''; + } + } else if (['instagram', 'twitter'].includes(item.type)) { + if (item.data.url) + result = '' + item.data.url + ''; + } else if (item.type === 'iframe') { + if (item.data.url) + result = ''; + } else if (!['callout', 'quote', 'relatedStory', 'video'].includes(item.type)) { + console.log(item); + } + } + } + return result; + } + let json_text = json.page.content.asset.body; + if (json_text) { + placeholders = json.page.content.asset.bodyPlaceholders; + if (placeholders) + json_text = json_text.replace(/<\/x-placeholder>/g, find_item); + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + json_text + '
', 'text/html'); + let content_new = doc.querySelector('div'); + let widget = document.querySelector('div[class$="-wrapper"] > div#WidgetContainer'); + if (article_sel.startsWith('#endOfArticle')) { + article.parentNode.replaceChild(content_new, article); + if (widget) + content_new.firstChild.before(widget.parentNode); + window.setTimeout(function () { + content_new.id = 'endOfArticle'; + }, 500); + } else + article.firstChild.before(content_new); + addStyle(article_sel + ' p {margin: 20px 0px;}'); + } else { + let parser = new DOMParser(); + let posts = json.page.content.asset.posts; + article.innerHTML = ''; + for (let post of posts) { + let asset = post.asset; + if (asset && asset.body) { + let json_text = asset.body; + placeholders = asset.bodyPlaceholders; + if (placeholders) + json_text = json_text.replace(/<\/x-placeholder>/g, find_item); + let doc = parser.parseFromString('
' + json_text + '
', 'text/html'); + let par = doc.querySelector('section'); + let header; + if (asset.headlines && asset.headlines.headline) { + header = document.createElement('h2'); + header.innerText = asset.headlines.headline; + header.id = post.id; + } + let byline; + if (asset.byline) { + byline = document.createElement('p'); + byline.innerText = asset.byline; + byline.style = 'margin-bottom: 24px;' + } + article.append(header, byline, par); + } + } + addStyle('section:not([class]) > p {margin: 24px 0px;}'); + let key_posts = document.querySelectorAll('li > a[href*="?post="]'); + for (let elem of key_posts) + elem.href = elem.href.replace('?post=', '#'); + } + } + } catch (err) { + console.log(err); + } + } + }); + } + }).catch(function (err) { + false; + }); + } + }, 1000); + } +} + +else if (matchDomain('businessdesk.co.nz')) { + let paywall = document.querySelector('div.paywall'); + if (paywall) { + paywall.classList.remove('paywall'); + let signup_box = document.querySelector('div.signup-box-container'); + removeDOMElement(signup_box); + let url = window.location.href.split(/[#\?]/)[0]; + fetch(url, {headers: {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"}}) + .then(response => { + if (response.ok) { + response.text().then(html => { + let match = html.match(/:query="'([^"]+)'"/); + if (match) { + let parser = new DOMParser(); + let src_text = breakText(parseHtmlEntities(match[1])).replace(/\n\n/g, '

').replace(/\.([^\s\d]|&)/g, ". $1"); + let doc = parser.parseFromString('
' + src_text + '
', 'text/html'); + let content_new = doc.querySelector('div'); + paywall.innerHTML = ''; + paywall.appendChild(content_new); + } + }) + } + }) + } +} + +else if (matchDomain(['crikey.com.au', 'smartcompany.com.au', 'themandarin.com.au'])) { + let ads = 'div.wp-block-pm-ad-placeholder-block'; + hideDOMStyle(ads); +} + +else if (matchDomain('forbes.com.au')) { + setCookie('blaize_session', '', 'forbes.com.au', '/', 0); + getJsonUrl('div[class*="_gate"]', '', 'div.article-page__content-body'); + let fade = document.querySelector('div[style*="background-image: linear-gradient"]'); + removeDOMElement(fade); +} + +else if (matchDomain('macrobusiness.com.au')) { + let paywall = pageContains('div > p', 'The full text of this article is available'); + if (paywall[0]) { + let fade = document.querySelector('div.bg-gradient-to-t'); + removeDOMElement(paywall[0].parentNode, fade); + let json_script = document.querySelector('script#__NUXT_DATA__'); + if (json_script) { + try { + let json = JSON.parse(json_script.text); + let json_text = json.filter(x => typeof x === 'string' && x.match(/(<|\\u003C)p>/))[0]; + if (json_text) { + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + json_text + '
', 'text/html'); + let content_new = doc.querySelector('div'); + let article = document.querySelector('div.content'); + if (article) { + article.innerHTML = ''; + article.appendChild(content_new); + } + } else + refreshCurrentTab(); + } catch (err) { + console.log(err); + } + } + } +} + +else if (matchDomain('nzherald.co.nz')) { + // use bpc adblocker filter + let premium_toaster = '#premium-toaster'; + hideDOMStyle(premium_toaster); +} + +else if (matchDomain('spectator.com.au')) { + getJsonUrl('section.paywall', '', 'div.article-body', {art_append: 1}); +} + +else if (matchDomain('thesaturdaypaper.com.au')) { + let hide_end = document.querySelector('div.hide-end'); + if (hide_end) + refreshCurrentTab(); + let paywall = document.querySelector('div.paywall-hard-always-show'); + removeDOMElement(paywall); +} + +else if (matchDomain(['brisbanetimes.com.au', 'smh.com.au', 'theage.com.au', 'watoday.com.au'])) { + if (!window.location.hostname.startsWith('amp.')) { + amp_redirect('head > meta[content^="FOR SUBSCRIBERS"], #paywall_prompt'); + } else { + amp_unhide_subscr_section(); + } +} + +else { + // Australian Community Media newspapers + let au_comm_media_domains = ['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', 'standard.net.au', 'theadvocate.com.au', 'thecourier.com.au', 'westernadvocate.com.au']; + if (matchDomain(au_comm_media_domains) || document.querySelector('div#footer a[href^="https://acm.media/"]')) { + let mask = document.querySelector('div[class^="gradient-mask-"]'); + if (mask) { + mask.removeAttribute('class'); + let div_hidden = document.querySelectorAll('div.flex-col div.hidden'); + for (let elem of div_hidden) + elem.classList.remove('hidden'); + } else { + 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 noscroll = document.querySelectorAll('html[style], body[style]'); + for (let elem of noscroll) + elem.removeAttribute('style'); + let story_generic_iframe = '.story-generic__iframe'; + let blocker = 'div.blocker'; + let overlays = 'div.transition-all, div[id^="headlessui-dialog"]'; + let ads = '.ad-placeholder, .sticky, [id*="-container"], #hindsight-ads-iframe, div.vf3-conversations-list__promo, div#tbl-next-up, iframe[data-ad-id]'; + hideDOMStyle(story_generic_iframe + ', ' + blocker + ', ' + overlays + ', ' + ads); + } else if (window.location.hostname.endsWith('.com.au')) { + // Australia News Corp + let au_news_corp_domains = ['adelaidenow.com.au', 'cairnspost.com.au', 'codesports.com.au', 'couriermail.com.au', 'dailytelegraph.com.au', 'geelongadvertiser.com.au', 'goldcoastbulletin.com.au', 'heraldsun.com.au', 'theaustralian.com.au', 'thechronicle.com.au', 'themercury.com.au', 'townsvillebulletin.com.au', 'weeklytimesnow.com.au']; + if (matchDomain(au_news_corp_domains) || matchDomain('ntnews.com.au')) { + let url = window.location.href; + if (window.location.pathname.startsWith('/subscribe/') && !url.includes('/digitalprinteditions')) { + let og_url = document.querySelector('head > meta[property="og:url"][content]'); + if (og_url) { + let url_new = og_url.content; + if (matchDomain('ntnews.com.au')) { + let article = document.querySelector('div.dsf-article-preview'); + if (article) { + article.before(googleSearchToolLink(url_new)); + } + } else { + url_new += '?amp'; + window.setTimeout(function () { + window.location.href = url_new; + }, 500); + } + } + } else if (window.location.search.match(/[&\?]amp/)) { + amp_unhide_subscr_section('[id^="ad-mrec-"]', false); + let figure_stretch = document.querySelectorAll('figure.stretch'); + for (let elem of figure_stretch) + elem.classList.remove('stretch'); + let comments = document.querySelector('#comments-load, .comments-module'); + removeDOMElement(comments); + } else { + if (window.location.pathname.includes('/video/') && document.querySelector('div.vms-premium-video')) + header_nofix('div.video-hub'); + let ads = '.header_ads-container, .ad-block'; + hideDOMStyle(ads); + } + } else { + // Australian Seven West Media + if (matchDomain('thewest.com.au') || document.querySelector('head > link[href="https://images.thewest.com.au"]')) { + function thewest_main(node) { + let filter = /^window\.PAGE_DATA\s?=\s?/; + let json_script = getSourceJsonScript(filter); + if (json_script) { + let json_text = json_script.text.split(filter)[1]; + json_text = json_text.replace(/:undefined([,}])/g, ':"undefined"$1'); + try { + let json_article = JSON.parse(json_text); + let json_pub; + for (let key in json_article) { + let json_resolution = json_article[key].data.result.resolution; + if (json_resolution && json_resolution.publication) { + json_pub = json_resolution.publication; + break; + } + } + let json_content = []; + let url_loaded; + if (json_pub) { + json_content = json_pub.content.blocks; + url_loaded = json_pub._self; + } else + refreshCurrentTab(); + //let json_video = json_pub.mainVideo; + let url = window.location.href; + if (!url_loaded || !url.includes(url_loaded.slice(-10))) + refreshCurrentTab(); + let par_elem, par_sub1, par_sub2; + let par_dom = document.createElement('div'); + let tweet_id = 1; + for (let par of json_content) { + par_elem = ''; + if (par.kind === 'text') { + par_elem = document.createElement('p'); + par_elem.innerText = par.text; + } else if (par.kind === 'subhead') { + par_elem = document.createElement('h2'); + par_elem.innerText = par.text; + } else if (par.kind === 'pull-quote') { + par_elem = document.createElement('i'); + par_elem.innerText = (par.attribution ? par.attribution + ': ' : '') + par.text; + } else if (par.kind === 'embed') { + if (par.reference.includes('https://omny.fm/') || par.reference.includes('https://docdro.id/')) { + par_elem = document.createElement('embed'); + par_elem.src = par.reference; + par_elem.style = 'height:500px; width:100%'; + par_elem.frameborder = '0'; + } else { + par_elem = document.createElement('a'); + par_elem.href = par.reference; + par_elem.innerText = par.reference.split('?')[0]; + } + } else if (par.kind === 'unordered-list') { + if (par.items) { + par_elem = document.createElement('ul'); + for (let item of par.items) + if (item.text) { + par_sub1 = document.createElement('li'); + if (item.intentions[0] && item.intentions[0].href) { + par_sub2 = document.createElement('a'); + par_sub2.href = item.intentions[0].href; + } else { + par_sub2 = document.createElement('span'); + } + par_sub2.innerText = item.text; + par_sub1.appendChild(par_sub2); + par_elem.appendChild(par_sub1); + } + } + } else if (par.kind === 'inline') { + if (par.asset.kind === 'image' && par.asset.original && par.asset.original.reference) { + par_elem = makeFigure(par.asset.original.reference, par.asset.captionText, {style: 'width:100%'}); + } + } else if (par.kind === 'inline-related') { + par_elem = document.createElement('p'); + if (par.publications) { + for (let elem of par.publications) { + let par_link = document.createElement('a'); + par_link.href = elem._self; + par_link.innerText = elem.heading; + par_elem.appendChild(par_link); + par_elem.appendChild(document.createElement('br')); + } + } + } else { + par_elem = document.createElement('p'); + par_elem.innerText = par.text; + console.log(par.kind); + } + if (par_elem) + par_dom.appendChild(par_elem); + } + let content = document.querySelector('div[class*="StyledArticleContent"]'); + if (content) { + content.innerHTML = ''; + content.appendChild(par_dom); + } else { + par_dom.setAttribute('style', 'margin: 20px;'); + node.before(par_dom); + } + } catch (err) { + console.log(err); + } + } + removeDOMElement(node); + } + let paywall_sel = 'div.paywall div[data-testid*="BreachScreen"], div[class*="StyledBreachWallContent"]'; + let paywall = document.querySelector(paywall_sel); + if (paywall) + thewest_main(paywall); + waitDOMElement(paywall_sel, 'DIV', thewest_main, true); + let ads = 'div.headerAdvertisement, div.disabled-ad, div.ad-no-notice'; + hideDOMStyle(ads); + } else if (document.querySelector('head > link[rel="dns-prefetch"][href="//static.ew.mmg.navigacloud.com"]')) { // McPherson Media Group + let paywall = document.querySelector('div#content-Load-message'); + if (paywall) { + removeDOMElement(paywall); + let lockable = document.querySelectorAll('div[id^="lockable-"]'); + for (let elem of lockable) { + elem.removeAttribute('style'); + elem.removeAttribute('id'); + } + let gradient = document.querySelector('div.gradienttext'); + if (gradient) + gradient.removeAttribute('class'); + } + } + } + } +} + +} else if ((window.location.hostname.match(/\.(ie|uk)$/) && !matchDomain(['vogue.co.uk'])) || matchDomain(['apollo-magazine.com', 'autosport.com', 'decanter.com', 'fnlondon.com', 'ft.com', 'gbnews.com', 'granta.com', 'iai.tv', 'irishexaminer.com', 'motorsportmagazine.com', 'newstatesman.com', 'scotsman.com', 'tes.com', 'the-tls.com', 'thelawyer.com', 'thetimes.com', 'unherd.com'])) {//united kingdom/ireland + +if (matchDomain('apollo-magazine.com')) { + setCookie('blaize_session', '', 'apollo-magazine.com', '/', 0); + let banner = document.querySelector('#subscribe-ribbon'); + removeDOMElement(banner); +} + +else if (matchDomain('autocar.co.uk')) { + let paywall = document.querySelector('div.ms-block, div.register-block'); + if (paywall) { + removeDOMElement(paywall); + let json_script = getArticleJsonScript(); + if (json_script) { + let json = JSON.parse(json_script.text); + if (json) { + let json_text = json.articleBody; + let article = document.querySelector('div.block-node'); + if (json_text && article) { + article.innerHTML = ''; + let article_new = document.createElement('p'); + article_new.innerText = json_text; + let fade = document.querySelector('div.article-section > div[style*="max-height"]'); + removeDOMElement(fade); + let url = window.location.href; + article.append(article_new, 'Text-only > for missing media/links: ', googleSearchToolLink(url)); + } + } + } + } + let ads = 'div[class*="-ads-"]'; + hideDOMStyle(ads); +} + +else if (matchDomain('autosport.com')) { + header_nofix('div.ms-article-content > p', 'div.ms-piano_article-banner'); +} + +else if (matchDomain(['belfasttelegraph.co.uk', 'independent.ie'])) { + let paywall = document.querySelector('div[class*="_fadetowhite"]'); + if (paywall) { + let content = document.querySelector('script[data-fragment-type="ArticleContent"]'); + if (content) { + removeDOMElement(paywall); + let flip_pay = 'div#flip-pay'; + hideDOMStyle(flip_pay, 5); + let intro = document.querySelector('div > div[data-auth-intro="article"]'); + if (intro) { + let intro_par = intro.querySelector('p[class]'); + let intro_par_class; + if (intro_par) + intro_par_class = intro_par.getAttribute('class'); + let content_text = content.innerText; + if (content_text.includes('__PRELOADED_STATE_GRAPH')) { + content_text = content_text.replace(/window\["__PRELOADED_STATE_GRAPH__.+"\]\s=\s/, ''); + try { + let json = JSON.parse(content_text); + if (Object.keys(json).length) { + let key = Object.keys(json)[0]; + let pars = json[key].data.article.body; + let parser = new DOMParser(); + for (let par of pars) { + for (let type in par) { + let item = par[type]; + let elem = document.createElement('p'); + elem.setAttribute('style', "margin: 10px;"); + if (type === 'bullet_list') { + let ul = document.createElement('ul'); + for (let sub_item of item) { + li.innerText = parseHtmlEntities(sub_item.replace(/<[^<]*>/g, '')); + li.innerText = sub_item; + ul.appendChild(li); + } + elem.appendChild(ul); + } else if (type === 'image') { + let url = item.url; + if (item.cropped && item.cropped.url) + url = item.cropped.url; + let figure = makeFigure(url, item.caption); + elem.appendChild(figure); + } else if (type === 'related') { + if (item.articles) { + let articles = item.articles; + for (let article of articles) { + let elem_link = document.createElement('a'); + elem_link.href = article.webcmsRelativeUrl; + elem_link.innerText = article.title; + elem_link.style = 'text-decoration: underline;'; + elem.append(elem_link, document.createElement('br')); + } + } + } else if (!['ad', 'quote', 'streamone'].includes(type)) { + let html = parser.parseFromString('

' + item + '

', 'text/html'); + elem = html.querySelector('p'); + elem.querySelectorAll('iframe[allow*="fullscreen"][allowfullscreen]').forEach(e => e.removeAttribute('allowfullscreen')); + if (!['p', 'subhead', 'legacy-ml'].includes(type)) { + console.log(type); + console.log(item); + } + } + window.setTimeout(function () { + if (elem) + intro.parentNode.appendChild(elem); + }, 500); + } + } + } + } catch (err) { + console.log(err); + } + } + } + } + } + let ads = 'div.ad'; + hideDOMStyle(ads); +} + +else if (matchDomain('businesspost.ie')) { + func_post = function () { + if (mobile) { + let lazy_images = document.querySelectorAll('div[style] > img[loading="lazy"][style]'); + for (let elem of lazy_images) { + elem.style = 'width: 95%;'; + elem.parentNode.removeAttribute('style'); + } + } + } + let url = window.location.href; + getArchive(url, 'div#bp_piano_article_subscription_offer', '', 'div[itemprop="articleBody"]'); + let ads = 'div[id^="Inline-MPU-article-"]'; + hideDOMStyle(ads); +} + +else if (matchDomain('decanter.com')) { + let paywall = document.querySelector('div[id^="react_subscriber_content_"]'); + if (paywall) { + removeDOMElement(paywall); + let data = document.querySelector('div[data-dom-id^="react_subscriber_content_"][data-props]'); + if (data) { + try { + let json = JSON.parse(data.getAttribute('data-props')); + if (json && json.content) { + let content = decode_utf8(atob(json.content)); + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + content + '
', 'text/html'); + let content_new = doc.querySelector('div'); + data.before(content_new); + header_nofix('div.collection-wrapper', '', 'BPC > no fix for reviews'); + let fade = 'div.piano-container-fade'; + hideDOMStyle(fade); + } + } catch (err) { + console.log(err); + } + } + } +} + +else if (matchDomain('fnlondon.com')) { + func_post = function () { + if (mobile) { + let lazy_images = document.querySelectorAll('picture > img[loading="lazy"][style]'); + for (let elem of lazy_images) { + elem.style = 'width: 95%;'; + elem.parentNode.removeAttribute('style'); + } + } + } + let url = window.location.href; + getArchive(url, 'div[data-testid="articleSignInSubscribeWrapper"]', '', 'article'); + let fade = 'div#cx-snippet'; + hideDOMStyle(fade); + function fnlondon_main(node) { + window.setTimeout(function () { + let signin_links = node.querySelectorAll('a[href^="https://www.fnlondon.com/client/login?target="]'); + for (let elem of signin_links) { + elem.href = '#';//elem.href.split('target=')[1].split('&')[0]; + elem.innerText = 'Open'; + elem.addEventListener('click', function () { window.location.reload(); }); + } + }, 500); + } + waitDOMElement('div[id^="continuous_article_"]', 'DIV', fnlondon_main, true); +} + +else if (matchDomain('ft.com')) { + func_post = function () { + let lazy_images = document.querySelectorAll('figure > picture > img[loading="lazy"][src^="data:image/gif"][new-cursrc]'); + for (let elem of lazy_images) { + elem.removeAttribute('loading'); + elem.style = 'width: 100%;'; + let figure = elem.parentNode.parentNode; + if (figure.parentNode && figure.parentNode.nodeName === 'DIV') + figure.parentNode.removeAttribute('style'); + elem.src = elem.getAttribute('new-cursrc'); + } + if (mobile) { + let grids = document.querySelectorAll('div[style*="grid-template-areas"], article#site-content'); + for (let elem of grids) + elem.style = 'margin: 10px;'; + } + } + let url = window.location.href; + getArchive(url, 'div#barrier-page', '', 'div.n-layout__row--content', '', 'div[style*="article-body"]', 'body'); + let banners = '.js-article-ribbon, div.o-ads, pg-slot'; + hideDOMStyle(banners); +} + +else if (matchDomain('gbnews.com')) { + let ads = 'div.ad--billboard, div.ad--placeholder, div.video-inbody'; + hideDOMStyle(ads); +} + +else if (matchDomain('granta.com')) { + getJsonUrl('div.article-sign-up-container', '', 'div.article-excerpt'); +} + +else if (matchDomain('iai.tv')) { + let paywall = document.querySelector('div.article-paywall-main'); + if (paywall) { + removeDOMElement(paywall); + let article = document.querySelector('div > div.iai-article--content-inner'); + if (article) { + let content_new = document.querySelector('head > meta[name="twitter:description"][content]'); + if (content_new) { + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + content_new.content + '
', 'text/html'); + let article_new = doc.querySelector('div'); + article.parentNode.replaceChild(article_new, article); + } + } + } +} + +else if (matchDomain('irishexaminer.com')) { + setCookie('blaize_session', '', 'irishexaminer.com', '/', 0); + let premium = document.querySelector('head > meta[name="isPremium"][content="true"]'); + let article = document.querySelector('article'); + if (premium && article) { + removeDOMElement(premium); + function stripAppLinks(story) { + story.querySelectorAll('a.readmore-event[href$="?type=app"]').forEach(e => e.href = e.href.split('?')[0]); + } + let url = window.location.href; + let app = window.location.search.startsWith('?type=app'); + if (!app) { + let paywall = document.querySelector('div#paywall-premium'); + if (paywall) { + let body_hide = article.querySelector('style:not(:empty)'); + removeDOMElement(paywall, body_hide); + let url_src = url.split(/[#\?]/)[0] + '?type=app'; + let story = article.querySelector('story'); + if (story) { + let podcast = article.querySelector('.bbw-embed'); + if (!podcast) { + fetch(url_src) + .then(response => { + if (response.ok) { + response.text().then(html => { + if (html.includes(' meta[name="isLongRead"][content="true"]'); + if (longread) { + removeDOMElement(longread); + let row = article.querySelector('div.row'); + if (row) + row.append(googleSearchToolLink(url.split('?')[0])); + } else { + let div = document.createElement('div'); + div.style.margin = '20px'; + let home = document.createElement('a'); + home.innerText = window.location.hostname; + home.href = 'https://' + window.location.hostname; + div.append(home); + article.before(div); + let story = article.querySelector('story'); + if (story) + stripAppLinks(story); + hideDOMStyle('.bbw-embed'); + } + } + } +} + +else if (matchDomain('literaryreview.co.uk')) { + getJsonUrl('p.subscribe-for-more', '', 'div#_articlereview'); +} + +else if (matchDomain('motorsportmagazine.com')) { + getJsonUrl('aside.paywall', '', 'div[data-behaviour="post-content"]'); + let banner = document.querySelector('div[data-behaviour="react-paywall-threshold"]'); + removeDOMElement(banner); + let ads = 'aside.ad-space'; + hideDOMStyle(ads); +} + +else if (matchDomain('newstatesman.com')) { + let ads = 'div.ad'; + hideDOMStyle(ads); +} + +else if (matchDomain('spectator.co.uk')) { + setCookie(['blaize_session', 'userArticleViews'], '', 'spectator.co.uk', '/', 0); + let paywall_sel = 'section.paywall, div.paywall-magazine'; + let entry_content = document.querySelector('div.entry-content'); + if (entry_content) + getJsonUrl(paywall_sel, '', 'div.entry-content', {art_append: 1}); + else + getJsonUrl(paywall_sel, '', 'div.entry-content__wrapper', {art_append:1, art_hold:1, art_class: 'entry-content'}); + let ads = '#subscribe-ribbon, div.ad-slot, div[style*="background-image: linear-gradient"]'; + hideDOMStyle(ads); +} + +else if (matchDomain('stylist.co.uk')) { + let paywall = document.querySelector('div[data-testid="paywall-component"]'); + if (paywall) { + removeDOMElement(paywall); + let paywall_inline = document.querySelector('div.paywall--inline'); + if (paywall_inline) + paywall_inline.removeAttribute('class'); + let json_script = document.querySelector('script#__NEXT_DATA__'); + if (json_script) { + try { + let json = JSON.parse(json_script.text); + if (json.props.pageProps.data.post.acf.widgets) { + let url_next = json.props.pageProps.data.post.id; + if (url_next && !window.location.pathname.endsWith(url_next)) + refreshCurrentTab(); + let pars = json.props.pageProps.data.post.acf.widgets; + let first_par = document.querySelector('main div[data-column="true"] > p'); + if (first_par) { + let article = first_par.parentNode; + let teaser = article.querySelectorAll('div > p:not([class])'); + removeDOMElement(...teaser); + if (article) { + let parser = new DOMParser(); + for (let par of pars) { + let elem = document.createElement('p'); + if (par.paragraph) { + let content = par.paragraph; + let content_new = parser.parseFromString('
' + content + '
', 'text/html'); + elem = content_new.querySelector('div'); + } else if (par.acf_fc_layout === 'heading') { + if (par.text) + elem.appendChild(document.createTextNode(par.text)); + } else if (['image', 'interactive_image'].includes(par.acf_fc_layout)) { + let image_array = []; + if (par.image) + image_array = [par.image]; + else if (par.image_collection) + image_array = par.image_collection; + for (let img_elem of image_array) { + let figure = makeFigure(img_elem.url, img_elem.caption ? (img_elem.caption + ' ' + img_elem.description) : img_elem.alt, {alt: img_elem.alt, style: 'width: 95%;'}); + elem.appendChild(figure); + } + } else if (par.acf_fc_layout === 'listicle') { + let ul = document.createElement('ul'); + for (let sub_item of par.item) { + let li = document.createElement('li'); + if (sub_item.url) { + let par_link = document.createElement('a'); + par_link.href = sub_item.url; + par_link.innerText = sub_item.title; + par_link.target = '_blank'; + li.appendChild(par_link); + } else + li.innerText = sub_item.title; + if (sub_item.paragraph) { + let content = sub_item.paragraph; + let content_new = parser.parseFromString('
' + content + '
', 'text/html'); + let par_elem = content_new.querySelector('div'); + li.appendChild(par_elem); + } + if (sub_item.image) { + let img = document.createElement('img'); + img.src = sub_item.image.url; + img.alt = sub_item.image.alt; + img.style = 'width: 95%;'; + li.appendChild(img); + li.appendChild(document.createElement('br')); + } + li.style = 'font-size: 20px; margin: 20px 0px;'; + ul.appendChild(li); + } + elem.appendChild(ul); + } else if (par.embed_link) { + let par_link = document.createElement('a'); + par_link.href = par.embed_link; + par_link.innerText = 'Embedded link: ' + par.embed_link; + par_link.target = '_blank'; + elem.appendChild(par_link); + } else if (par.acf_fc_layout === 'divider') { + elem.appendChild(document.createElement('hr')); + } else if (par.acf_fc_layout === 'related_articles') { + if (par.posts) { + for (let post of par.posts) { + if (post.link && post.title.rendered) { + let par_link = document.createElement('a'); + par_link.href = post.link; + par_link.innerText = 'You may also like: ' + post.title.rendered; + elem.appendChild(par_link); + elem.appendChild(document.createElement('br')); + } + } + } + } else if (!['newsletter_signup', 'pull-quote'].includes(par.acf_fc_layout)) + console.log(par); + if (elem.hasChildNodes()) { + elem.style = 'font-family: "Source Serif Pro"; font-size: 20px; line-height: 34px;'; + article.appendChild(elem); + } + } + } + } + } + } catch (err) { + console.log(err); + } + } + } +} + +else if (matchDomain('telegraph.co.uk')) { + let subwall = '[class^="subwall"]'; + let ads = '.advert, .commercial-unit'; + hideDOMStyle(subwall + ', ' + ads); +} + +else if (matchDomain('tes.com')) { + let paywall = document.querySelector('div.tg-paywall-message'); + if (paywall) { + removeDOMElement(paywall); + let overlay = document.querySelector('div.tg-paywall-body-overlay'); + if (overlay) + overlay.removeAttribute('class'); + } + let banner = document.querySelector('div.js-paywall-info'); + removeDOMElement(banner); +} + +else if (matchDomain('the-tls.com')) { + getJsonUrl('div.tls-single-article__closed-paywall', '', 'div.tls-article-body', {art_class: 'tls-article-body'}); + let fade = 'div.tls-single-article__closed-paywall-wrapper'; + let ads = 'div[class*="tls-single-article__ad-slot"]'; + hideDOMStyle(fade + ', ' + ads); +} + +else if (matchDomain('thelawyer.com')) { + if (window.location.pathname.startsWith('/mda/')) { + header_nofix('div.sf-content__post', 'div.sf-login-form'); + } else if (true) { + let body = document.querySelector('body[class*="postid-"]'); + if (body) { + let article_id = body.className.split('postid-')[1].split(' ')[0]; + if (article_id) { + func_post = function () { + let lazy_images = document.querySelectorAll('img.lazy[data-src]:not([src])'); + for (let elem of lazy_images) { + elem.src = elem.getAttribute('data-src'); + elem.removeAttribute('class'); + } + } + getJsonUrl('div.sf-login-form', '', 'div.sf-content-body__text', {art_append: 1}, article_id, '', false, true); + } + } + } +} + +else if (matchDomain('thenewworld.co.uk')) { + let paywall = document.querySelector('div[data-show-fade-on-noaccess]'); + if (paywall) { + removeDOMElement(paywall); + let content = document.querySelector('div[data-show-has-access]'); + if (content) + content.removeAttribute('data-show-has-access'); + } + let banners = document.querySelectorAll('div[data-show-subs-blocked]'); + removeDOMElement(...banners); +} + +else if (matchDomain('thenewslens.com')) { + let paywall = document.querySelector('div.article-mask-box'); + if (paywall) { + removeDOMElement(paywall); + let json_script = getArticleJsonScript(); + if (json_script) { + let json = JSON.parse(json_script.text); + if (json) { + let json_text = json.articleBody; + let article = document.querySelector('section.article-body'); + if (json_text && article) { + let article_text = article.innerText.replace(/\n/g, ''); + let split = json_text.split('。'); + for (let elem of split) { + if (!elem.includes('(function(') && !article_text.includes(elem)) { + let par_new = document.createElement('p'); + par_new.innerText = elem + '。'; + article.append(par_new); + } + } + } + } + } + } +} + +else if (matchDomain('thestage.co.uk')) { + func_post = function () { + let paywall = document.querySelector(paywall_sel); + if (paywall) { + removeDOMElement(paywall); + let article = document.querySelector(article_sel); + if (article) + article.before(googleSearchToolLink(url)); + } + } + let paywall_sel = 'div#ao-MeteringDNAllow'; + let article_sel = 'div[id^="aos-FeatureArticle2Col-"], div[id^="aos-ReviewArticle-"]'; + let url = window.location.href; + getArchive(url, paywall_sel, '', article_sel); +} + +else if (matchDomain(['thesun.co.uk', 'thescottishsun.co.uk'])) { + let ads = 'div.billboard, div.advert-wrapper'; + hideDOMStyle(ads); +} + +else if (matchDomain('thetimes.com')) { + if (!matchDomain('epaper.thetimes.com')) { + func_post = function () { + let article = document.querySelector(article_sel); + if (article) { + if (mobile) { + let inline_images = article.querySelectorAll('img[style]'); + for (let elem of inline_images) { + elem.style = 'display: block; margin-left: auto; margin-right: auto; width: 90%;'; + let parent_node = elem.parentNode; + if (parent_node.tagName === 'PICTURE') + parent_node = parent_node.parentNode; + parent_node.removeAttribute('style'); + } + article.querySelectorAll('div[style*=";width:"]').forEach(e => e.style.width = '90%'); + let author = document.querySelector(article_sel + ' div[style^="min-height:"]:has(a[href^="https://www.thetimes.com/profile/"])'); + if (author) + author.style = 'width: 90%; margin: 20px;'; + } + let embed_iframes = article.querySelectorAll('div > times-embed-iframe-max[src]'); + for (let elem of embed_iframes) { + let iframe_new; + let iframe_src = elem.getAttribute('src'); + if (iframe_src.startsWith('https://youtube.com/')) { + iframe_new = document.createElement('iframe'); + iframe_new.src = iframe_src; + iframe_new.style = 'width: 100%; aspect-ratio: 16 / 9; border: none;'; + } else if (iframe_src.startsWith('https://www.tiktok.com/')) { + iframe_new = document.createElement('iframe'); + iframe_new.src = iframe_src; + iframe_new.style = 'width: 400px; aspect-ratio: 1 / 2; border: none;'; + } else if (iframe_src.startsWith('https://embed.acast.com/')) { + iframe_new = document.createElement('iframe'); + iframe_new.src = iframe_src; + iframe_new.style = 'width: 100%; border: none;'; + } else { + iframe_new = document.createElement('a'); + iframe_new.href = iframe_new.innerText = iframe_src; + iframe_new.target = '_blank'; + } + elem.parentNode.parentNode.replaceChild(iframe_new, elem.parentNode); + } + } + } + let article_sel = 'article[id]'; + if (!window.location.search.startsWith('?shareToken=')) { + let teaser = document.querySelector('body[data-view-name="teaser-article"]'); + if (teaser) { + teaser.classList.remove('TeaserPage'); + let url = window.location.href; + getArchive(url, 'div#paywall-portal-article-footer', '', article_sel); + let scroll_style = 'html, body {overflow: auto !important;}'; + addStyle(scroll_style); + } + } + let banners = 'div#paywall-portal-page-footer, .subscription-block'; + let ads = 'div.channel-header-ad, div[id^="advert-"], div[class*="InlineAdWrapper"], div:has(> div > div#ad-header), div[style*="border-bottom-color:"]:has(> div > div[id^="ad-article-inline"])'; + hideDOMStyle(banners + ', ' + ads); + } +} + +else if (matchDomain('unherd.com')) { + let preview = document.querySelector('div#premiumpreview'); + if (preview) { + removeDOMElement(preview); + let premium = document.querySelector('div#premiumcontent'); + if (premium) + premium.removeAttribute('id'); + } +} + +else if (matchDomain(uk_dmg_media_domains)) { + let paywall = document.querySelector('body.is-paywalled-article'); + if (paywall) + paywall.classList.remove('is-paywalled-article'); + let ads = 'ad-slot, div.billboard-container'; + hideDOMStyle(ads); +} + +else if (matchDomain(uk_nat_world_domains) || document.querySelector('footer > div a[href^="https://corporate.nationalworld.com"]')) { + let premium = document.querySelector('div.premium.no-entitlement'); + if (premium) + premium.classList.remove('premium', 'no-entitlement'); + let ads = 'div[class^="MarkupAds__Container-"], div[class*="_AdContainer-"], div[class^="Dailymotion__Wrapper-"], div.banner, div#mantis-carousel-wrapper:has( > mantis-ui-widget:empty)'; + hideDOMStyle(ads); +} + +} else { + +if (matchDomain(usa_adv_local_domains)) { + if (!window.location.search.startsWith('?outputType=amp')) { + amp_redirect('div.paywall', '', window.location.pathname + '?outputType=amp'); + } + let ads = 'div.ad, div.ad-inner, div.ad-unit, div#below-toprail, div[id^="taboola"]'; + hideDOMStyle(ads); +} + +else if (matchDomain('adweek.com')) { + setCookie('blaize_session', '', '.www.adweek.com', '/', 0); + let paywall = document.querySelector('div.paywall'); + if (paywall) { + removeDOMElement(paywall); + let fade = 'div.adw-article-body div[style*="linear-gradient"]'; + hideDOMStyle(fade); + let article = document.querySelector('div.non-paywall'); + if (article) { + let json_script = getArticleJsonScript(); + if (json_script) { + try { + let json = JSON.parse(json_script.text); + if (json && json.sharedContent) { + let json_text = json.sharedContent.articleBody; + if (json_text.match(/\[[^\[]+]/)) { + let url = window.location.href; + article.after(googleSearchToolLink(url)); + header_nofix('div#bpc_archive', '', 'BPC > no fix (missing (social) media)'); + } + json_text = json_text.replace(/\[[^\[]+]/g, '').replace(/((\r)?\n)+/g, '\r\n\r\n'); + if (json_text) + article.innerText = json_text; + } + } catch (err) { + console.log(err); + } + } + } + } +} + +else if (matchDomain('ajc.com')) { + let paygate = document.querySelector('div.story-paygate_placeholder'); + if (paygate) + paygate.removeAttribute('class'); + else { + let article_paywall = document.querySelectorAll('article.is-paywalled'); + if (article_paywall.length) { + let intro_len = document.querySelectorAll('article:not(.is-paywalled) > p').length; + let art_pars = document.querySelectorAll('article.is-paywalled > p'); + article_paywall.forEach(e => e.classList.remove('is-paywalled')); + let scripts = document.querySelectorAll('script:not([src], [type])'); + let json_script; + let script_start = 'self.__next_f.push([1,"'; + for (let script of scripts) { + if (script.text.startsWith(script_start)) { + if (script.text.includes('{\\"contentData\\":')) { + json_script = script; + break; + } + } + } + if (json_script) { + let json_pars_text = json_script.text.split('{\\"contentData\\":')[1].split(',\\"contentMeta\\":{')[0].replace(/\\"/g, '"').replace(/\\\"/g, '\"'); + try { + let json_pars = JSON.parse(json_pars_text).content_elements.filter(e => e.type === 'text' && e.content); + let par_nr = intro_len; + for (let par of art_pars) { + par.innerHTML = json_pars[par_nr].content; + par_nr++; + } + } catch (err) { + console.log(err); + } + } + } + } + let video_blocker = document.querySelector('div.video-blocker'); + removeDOMElement(video_blocker); + let ads = 'div.arc_ad'; + hideDOMStyle(ads); +} + +else if (matchDomain('al-monitor.com')) { + func_post = function () { + if (mobile) { + let article = document.querySelector(article_sel); + if (article) { + let lazy_images = article.querySelectorAll('picture > img[loading="lazy"][style]'); + for (let elem of lazy_images) { + elem.style = 'width: 95%;'; + elem.parentNode.removeAttribute('style'); + } + let art_width = article.offsetWidth - 20 + 'px'; + let header = document.querySelector('header'); + if (header) + header.style.width = art_width; + let elems = article.querySelectorAll(':not(a, svg)[style*="width"]'); + for (elem of elems) { + elem.style.width = art_width; + elem.style['grid-template-columns'] = ''; + } + let lang = article.querySelector('div[style] > ul[style*="align-items"]'); + if (lang) + lang.parentNode.removeAttribute('style'); + let par = article.querySelector('div[style] > div[dir="ltr"]'); + if (par) + par.parentNode.style = 'width: ' + art_width; + } + } + } + let url = window.location.href; + let article_sel = 'article'; + getArchive(url, 'div.node__paywall-cta', '', article_sel, '', article_sel, article_sel + ' > div'); +} + +else if (matchDomain('americanbanker.com') || matchDomain(usa_arizent_custom_domains)) { + let inline_gate = document.querySelector('.inline-gate'); + if (inline_gate) { + inline_gate.classList.remove('inline-gate'); + let inline_gated = document.querySelectorAll('.inline-gated'); + for (let elem of inline_gated) + elem.classList.remove('inline-gated'); + } + let ads = document.querySelectorAll('div.GoogleDfpAd'); + removeDOMElement(...ads); +} + +else if (matchDomain('artnet.com')) { + if (window.location.pathname.endsWith('/amp-page')) { + amp_unhide_subscr_section(); + } else { + let body_hidden = document.querySelector('.article-body'); + if (body_hidden) + body_hidden.style = 'display:block;'; + let banner = document.querySelector('div[id^="issuem-leaky-paywall-"]'); + removeDOMElement(banner); + } +} + +else if (matchDomain('asia.nikkei.com')) { + let paywall = document.querySelector('div#paywall-offer'); + if (paywall) { + removeDOMElement(paywall); + let article = document.querySelector('div#article-body-preview > div'); + if (article) { + let json_script = document.querySelector('script#__NEXT_DATA__'); + if (json_script) { + try { + let json = JSON.parse(json_script.text); + if (json && json.props.pageProps.data.body) { + let json_text = json.props.pageProps.data.body; + if (!json_text.includes('
')) + json_text = '
' + json_text + '
'; + let parser = new DOMParser(); + let doc = parser.parseFromString(json_text, 'text/html'); + let article_new = doc.querySelector('div'); + article.parentNode.replaceChild(article_new, article); + } else + refreshCurrentTab(); + } catch (err) { + console.log(err); + } + } + } + } + let banners = 'div#pianoj_ribbon, div#paywall-offer'; + hideDOMStyle(banners); +} + +else if (matchDomain('axios.com')) { + function axios_noscroll(node) { + node.removeAttribute('style'); + let overlay = 'div[class^="Modal_paywall"], div[class^="Modal_cta"]'; + hideDOMStyle(overlay, 2); + } + let noscroll = document.querySelector('html[style]'); + if (noscroll) + axios_noscroll(noscroll); + waitDOMAttribute('html', 'HTML', 'style', axios_noscroll, true); + let banners = 'div[data-cy="pro-paywall"], div.apexAd, div[class*="NativeAd"], span[data-ad-type]'; + hideDOMStyle(banners); +} + +else if (matchDomain('balkaninsight.com')) { + getJsonUrl('div.subscribeWrapper', '', 'div.post_teaser', {art_append: 1, art_hold: 1}); +} + +else if (matchDomain(['barandbench.com', 'theleaflet.in', 'thenewsminute.com'])) { + let paywall = document.querySelector('div[id*="paywall-banner"]'); + if (paywall) { + removeDOMElement(paywall); + let article = document.querySelector('div.paywall'); + if (article) { + let article_new = getArticleQuintype(); + if (article_new && article.parentNode) + article.parentNode.replaceChild(article_new, article); + } + } +} + +else if (matchDomain('barrons.com')) { + if (window.location.pathname.startsWith('/livecoverage/')) { + window.setTimeout(function () { + fix_dowjones_live(); + }, 1500); + } else { + let paywall = document.querySelector('div#cx-interstitial-snippet, div[data-id^="ArticleRoadblock_"]'); + if (paywall) { + removeDOMElement(paywall); + window.setTimeout(function () { + let articles = document.querySelectorAll('article > div.crawler'); + let article; + for (let elem of articles) { + let paragraph = elem.querySelector('p[class*="Paragraph"]'); + if (paragraph) { + article = elem; + break; + } + } + if (article) { + let article_id_dom = document.querySelector('head > meta[name="article.id"][content]'); + if (article_id_dom) { + let article_id = article_id_dom.content; + let url_src = 'https://barrons.djmedia.djservices.io/apps/barrons/theaters/default-article?screen_ids=' + article_id; + let x_access_token = "eyJhbGciOiJSUzI1NiJ9.WFZsaHN3MXd3Smw0V3kwRXBzclQ.qwwBedAUNXHTQchowQZ5zMwmnXqDKeMhoRJlkB7drjWmb0ktZCScIhq5lpIiWaMyNJA_ODYgHAfIoi7DKWkS8g8GunFNAXpJDUOLdI2rtQkTEi_E3o90rdZHunPR7p0ULjRmHCnDofAdpTQdJtTXjQ9eEDZT2xoooVGdBpoVKhE"; + getExtFetch(url_src, '', {"app-identifier": "http://com.news.screens", "device-type": "phone", "x-access-token": x_access_token}, fix_dowjones_fetch, [article]); + } + } + }, 2000); + } + } + let signin_links = document.querySelectorAll('p > a[href^="https://www.barrons.com/client/login"][href*="target="]'); + for (let elem of signin_links) { + elem.href = decodeURIComponent(elem.href.split('target=')[1].split('&')[0]); + elem.innerText = 'Open'; + elem.target = '_top'; + } + let ads = document.querySelectorAll('div[class] > div.uds-ad-container'); + for (let ad of ads) + hideDOMElement(ad.parentNode); +} + +else if (matchDomain('benzinga.com')) { + function benz_main(node) { + removeDOMElement(node); + if (!window.location.pathname.startsWith('/report/')) { + let blurred = document.querySelector('div.article-content-paywalled'); + if (blurred) { + blurred.classList.remove('article-content-paywalled'); + let key_points = document.querySelectorAll('li.blur-sm'); + for (let elem of key_points) + elem.classList.remove('blur-sm'); + let article = document.querySelector('div#article-body'); + if (article) { + let json_script = document.querySelector('script#__NEXT_DATA__'); + if (json_script) { + try { + let json = JSON.parse(json_script.text); + if (json && json.props.pageProps.article.primaryImage) { + let img_data = json.props.pageProps.article.primaryImage; + if (img_data.url) { + let img = document.createElement('img'); + img.src = img_data.url; + img.alt = img_data.alt; + article.before(img); + } + } + } catch (err) { + console.log(err); + } + } + } + } + } else { + let blurred = document.querySelector('div.blur-lg'); + if (blurred) + blurred.classList.remove('blur-lg'); + } + } + waitDOMElement('div.paywall-content', 'DIV', benz_main, false); +} + +else if (matchDomain('bhaskar.com')) { + if (!window.location.pathname.startsWith('/amp/')) { + let paywall_sel = 'div.paywallBlockedContent'; + let paywall = document.querySelector(paywall_sel); + if (paywall) { + let banner = document.querySelector(paywall_sel + ' ~ div'); + if (banner) + removeDOMElement(banner); + paywall.removeAttribute('class'); + } + let ads = document.querySelectorAll('div[style*="overflow:hidden"][style*="max-height:"], div[id^="Ad--"], article div:empty'); + if (ads) + removeDOMElement(...ads); + } else + ampToHtml(); +} + +else if (matchDomain('bizjournals.com')) { + if (window.location.pathname.includes('/subscriber-only/')) { + header_nofix('div.primary'); + } else { + let paywall = document.querySelector('div.paywall-content:empty'); + if (paywall) { + paywall.classList.remove('paywall-content'); + let article = document.querySelector('div#ContentTease'); + if (article) { + let json_script = document.querySelector('script#__NUXT_DATA__'); + if (json_script) { + try { + let json = JSON.parse(json_script.text); + if (json) { + let pars_index = json.indexOf('paragraph') + 1; + if (pars_index) { + let intro = article.querySelector('p[class]'); + let par_class = intro ? intro.className : 'content mb-4'; + article.innerHTML = ''; + let parser = new DOMParser(); + let hl_index = json.indexOf('highlights') + 1; + if (hl_index) { + let container = document.createElement('div'); + container.className = 'border border-gray-300 p-2 font-sans'; + container.style = 'margin-bottom: 20px;'; + let title = document.createElement('h3'); + title.className = 'pb-4 font-bold'; + title.innerText = 'Story Highlights'; + let doc = parser.parseFromString('
' + json[hl_index] + '
', 'text/html'); + let highlights = doc.querySelector('div'); + container.append(title, highlights); + article.appendChild(container); + } + let json_images = json.filter(x => x && x.ord && x.url); + for (let i = pars_index; i < json.length; i++) { + let par = json[i]; + if (!par) + continue; + let style; + if (par === 'header') { + style = 'font-weight: bold;'; + i++; + par = json[i]; + } else if (par.type && json[par.type] === 'media') { + let json_img = json_images.find(x => x.ord === par.ord); + if (json_img) { + let figure = makeFigure(json[json_img.url], json[json_img.caption] + (json[json_img.byline] ? '\r\n' + json[json_img.byline].toUpperCase() : '')); + figure.className = par_class; + article.appendChild(figure); + } + } + if (typeof par === 'string' && !['default', 'embed', 'horizontal_line', 'image', 'list', 'media', 'top25list'].includes(par)) { + if (par.match(/^\d{4}-\d{2}-/)) + break; + let doc = parser.parseFromString('
' + par + '
', 'text/html'); + let par_new = doc.querySelector('div'); + par_new.querySelectorAll('iframe[allow*="fullscreen"][allowfullscreen]').forEach(e => e.removeAttribute('allowfullscreen')); + if (style) + par_new.style = style; + article.appendChild(par_new); + } else if (par.is_primary || par['primary-channel']) + break; + } + } + } + } catch (err) { + console.log(err); + } + } + } + } + window.setTimeout(function () { + let dialog = document.querySelector('div[id^="headlessui-dialog-"], div.sheet-overlay'); + if (dialog) { + removeDOMElement(dialog); + let html = document.querySelector('html[style]'); + if (html) + html.removeAttribute('style'); + let overlays = document.querySelectorAll('html.is-overlaid, body.is-overlaid'); + for (let elem of overlays) + elem.classList.remove('is-overlaid'); + let nuxt_inert = document.querySelector('div#__nuxt[inert]'); + if (nuxt_inert) + nuxt_inert.removeAttribute('inert'); + } + }, 1000); + } + let ads = 'div.adwrap, div[data-dev="MovableAd"]'; + hideDOMStyle(ads); +} + +else if (matchDomain('bloomberg.com')) { + let paywall_sel = 'div[id^="fortress-"]'; + let leaderboard = 'div[id^="leaderboard"], div[class^="leaderboard"], div.canopy-container'; + let ads = 'div[data-ad-status], div[data-ad-type], div[class*="FullWidthAd_"], div.adWrapper'; + hideDOMStyle(paywall_sel + ', ' + leaderboard + ', ' + ads); + waitDOMElement(paywall_sel, 'DIV', removeDOMElement, true); + waitDOMAttribute('body', 'BODY', 'data-paywall-overlay-status', node => node.removeAttribute('data-paywall-overlay-status'), true); + if (window.location.pathname.startsWith('/live/')) { + setInterval(function () { + window.localStorage.clear(); + }, 15 * 60 * 1000); + } else + window.localStorage.clear(); + window.setTimeout(function () { + let shimmering = document.querySelector('article.first-story div[class*="Placeholder_placeholderParagraphWrapper-"]'); + if (shimmering) { + header_nofix(shimmering.parentNode, '', 'BPC > enable JavaScript for site'); + } + }, 5000); +} + +else if (matchDomain('bloombergadria.com')) { + let article_hidden = document.querySelector('article.single-news[style]'); + if (article_hidden) + article_hidden.removeAttribute('style'); + let ads = '.banner'; + hideDOMStyle(ads); +} + +else if (matchDomain('bostonglobe.com')) { + if (window.location.search.startsWith('?outputType=amp')) + amp_unhide_subscr_section(); +} + +else if (matchDomain('business-standard.com')) { + function bs_main(node) { + removeDOMElement(node); + let audio_tts = document.querySelector('audio[src$="-short.mp3"]'); + if (audio_tts) + audio_tts.src = audio_tts.src.replace('-short', ''); + let json_script = document.querySelector('script#__NEXT_DATA__'); + if (json_script) { + try { + let json = JSON.parse(json_script.text); + if (json && json.props.pageProps.data.htmlContent) { + let json_text = json.props.pageProps.data.htmlContent; + let article = document.querySelector('div[class^="MainStory_storycontent__"], div[class^="blueprint-story-detail_storbpcontent_"]'); + if (json_text && article) { + removeDOMElement(json_script); + article.innerHTML = ''; + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + json_text + '
', 'text/html'); + let article_new = doc.querySelector('div'); + if (article_new) { + let zoom_images = article_new.querySelectorAll('div > img.zoomimg'); + for (let img of zoom_images) { + let caption = img.parentNode.querySelector('div[style]'); + if (caption) + caption.removeAttribute('style'); + } + window.setTimeout(function () { + article.appendChild(article_new); + }, 1000); + } + } + } else + refreshCurrentTab(); + } catch (err) { + console.log(err); + } + } + } + if (!window.location.pathname.startsWith('/amp/')) { + if (true) { + let paywall_sel = 'div[class^="subscription_subscriptionPlan_"], div[class^="BluePrintPaywall_BPstoryPaywall_"]'; + let paywall = document.querySelector(paywall_sel); + if (paywall) { + bs_main(paywall); + } else { + csDoneOnce = true; + waitDOMElement(paywall_sel, 'DIV', bs_main, false); + } + } + let banner = 'section.sbcrbtmlfull, div.subscribfixed_artcalLeftBox__hmpMi'; + let ads = 'div.advertisement-bg, div[id^="between_article_content_"]'; + hideDOMStyle(banner + ', ' + ads); + } else + ampToHtml(); +} + +else if (matchDomain('businessinsider.com')) { + let ads = 'div.masthead-ad, div.l-ad, div.in-post-sticky, aside.has-video-ad, div.ad-callout-wrapper'; + hideDOMStyle(ads); +} + +else if (matchDomain('businessinsider.jp')) { + let paywall = document.querySelector('div.piano-paywall-container[hidden]'); + if (paywall) + paywall.removeAttribute('hidden'); +} + +else if (matchDomain('businessoffashion.com')) { + let ads = 'div[class^="default__AdsBlockWrapper"], div[data-test="common-nbabanner"]'; + hideDOMStyle(ads); +} + +else if (matchDomain('capital.bg')) { + let paywall = document.querySelector('section > article > footer > a[data-referral="Paywall"]'); + if (paywall) { + removeDOMElement(paywall); + let json_script = getArticleJsonScript(); + if (json_script) { + let json = JSON.parse(json_script.text); + if (json) { + let json_text = json.articleBody; + let img_main = document.querySelector('div.story--header picture > img[src]'); + let article = document.querySelector('div.story-content'); + if (json_text && article) { + article.innerHTML = ''; + let article_new = document.createElement('p'); + let json_pars = parseHtmlEntities(json_text).replace(/\s{2,}/g, '\r\n\r\n').split(/[\[\]]{2}/); + for (let elem of json_pars) { + let par; + if (!elem.match(/[\[\]]{2}/)) { + if (elem.match(/img:\d+/)) { + if (img_main) { + let img_new_id = elem.split('img:')[1]; + if (img_new_id) { + par = document.createElement('img'); + par.src = img_main.src.replace(/_\d+\./, '_' + img_new_id + '.').split('?')[0]; + par.style = 'margin: 20px; width: 90%;'; + } + } + } else if (!elem.match(/(embed|quote):\d+/)) { + par = document.createElement('p'); + par.innerText = elem; + } + } + if (par) + article.appendChild(par); + } + } + } + } + } else + header_nofix('div.story-content > p', 'section > header > a[data-referral="Paywall"]'); +} + +else if (matchDomain(['chronicle.com', 'philanthropy.com'])) { + let preview = document.querySelector('div[data-content-summary]'); + removeDOMElement(preview); + let article_hidden = document.querySelector('div[class~="contentBody" i][hidden]'); + if (article_hidden) { + let attributes = [...article_hidden.attributes].filter(x => x.name !== 'class'); + for (let elem of attributes) + article_hidden.removeAttribute(elem.name); + } + let ads = 'div.GoogleDfpAd-container'; + hideDOMStyle(ads); +} + +else if (matchDomain('cnbc.com')) { + let paywall = document.querySelector('div.ArticleGate-proGate'); + if (paywall) { + removeDOMElement(paywall); + let article = document.querySelector('div.ArticleBody-articleBody'); + if (article) + article.style = "margin: 20px; font-family: Lyon,Helvetica,Arial,sans-serif; font-size: 18px; line-height: 1.66"; + let span_hidden = document.querySelectorAll('span[hidden]'); + for (let elem of span_hidden) { + elem.removeAttribute('hidden'); + elem.removeAttribute('class'); + if (elem.innerText) + elem.innerText = elem.innerText.split('DISCLOSURES: (None)')[0]; + } + let inline_image = document.querySelector('div[data-test="InlineImage"]'); + if (inline_image) + article.firstChild.before(inline_image); + } +} + +else if (matchDomain('cnn.com')) { + let subwall = document.querySelector('div[data-component-id="subwall"]'); + if (subwall) { + removeDOMElement(subwall); + let noscroll = document.querySelectorAll('html[style], body[style]'); + for (let elem of noscroll) + elem.removeAttribute('style'); + waitDOMAttribute('html', 'HTML', 'style', node => node.removeAttribute('style'), true); + waitDOMAttribute('body', 'BODY', 'style', node => node.removeAttribute('style'), true); + } + let regwall_keys = Object.keys(window.localStorage).filter(x => x.match(/reg_?wall/i)); + for (let item of regwall_keys) + window.localStorage.removeItem(item); + let ads = 'div[class*="ad-slot-"], div.container__ads'; + hideDOMStyle(ads); +} + +else if (matchDomain('columbian.com')) { + setCookie('blaize_session', '', 'columbian.com', '/', 0); + header_nofix('story', 'div#inline-paywall'); + let ads = 'div.modal, div#sticky-footer-cta, div.article-inline, div[id^="ad-instory-"], div#onesignal-slidedown-container'; + hideDOMStyle(ads); +} + +else if (matchDomain('csmonitor.com')) { + let paywall = document.querySelector('div.paywall'); + removeDOMElement(paywall); + window.localStorage.clear(); +} + +else if (matchDomain('cyclingnews.com')) { + let paywall = document.querySelector('div.paywall-locker'); + if (paywall) { + paywall.classList.remove('paywall-locker'); + let banner = 'div.kiosq-main-layer'; + hideDOMStyle(banner); + } + let metered_keys = Object.keys(window.localStorage).filter(x => x.match(/^kiosq_article/)); + for (let item of metered_keys) + window.localStorage.removeItem(item); +} + +else if (matchDomain('dailyherald.com')) { + let ads = 'div.dhTopAd, div[data-widget-host="revcontent"]'; + hideDOMStyle(ads); +} + +else if (matchDomain('dailywire.com')) { + let paywall = document.querySelector('div#payed-article-paywall'); + if (paywall) { + removeDOMElement(paywall); + let div_hidden = document.querySelector('#post-body-text > div > div[class]'); + if (div_hidden) + div_hidden.removeAttribute('class'); + } + let ads = 'div.ad-wrapper'; + hideDOMStyle(ads); +} + +else if (matchDomain('dallasnews.com')) { + if (window.location.search.startsWith('?outputType=amp')) { + amp_unhide_subscr_section(); + } +} + +else if (matchDomain('defector.com')) { + let paywall = document.querySelector('div[class^="ContentGate_wrapper__"]'); + if (paywall) { + removeDOMElement(paywall); + let article_sel = 'div[class^="PostContent_wrapper__"]'; + let article = document.querySelector(article_sel); + if (article) { + window.setTimeout(function () { + let pars = article.querySelectorAll('p'); + if (pars.length < 3) { + let url = window.location.href.split('?')[0]; + replaceDomElementExt(url, false, false, article_sel); + } + }, 1000); + } + } +} + +else if (matchDomain('denik.cz')) { + let video_sources = document.querySelectorAll('video[id] > source[src]'); + for (let elem of video_sources) { + let iframe = document.createElement('iframe'); + iframe.src = elem.src; + iframe.style = 'width: 100%; height: 100%;'; + let video = elem.parentNode; + video.parentNode.replaceChild(iframe, video); + } + let ads = 'div.ad'; + hideDOMStyle(ads); +} + +else if (matchDomain(['digiday.com', 'glossy.co', 'modernretail.co'])) { + let ads = 'div[class^="ad_"]'; + hideDOMStyle(ads); +} + +else if (matchDomain('discovermagazine.com')) { + window.setTimeout(function () { + let body = document.querySelector('body'); + if (body) + body.style = 'overflow: auto !important;'; + let banners = 'div.fIkXwQ, div[style*="fadeIn"], div[role="button"][aria-label="Dismiss Dialog"]'; + hideDOMStyle(banners); + }, 1000); +} + +else if (matchDomain('dnevnik.bg')) { + window.setTimeout(function () { + let paywall = document.querySelector('div.paywall-container'); + if (paywall) { + removeDOMElement(paywall); + function addGST() { + let url = window.location.href; + let article = document.querySelector('div.story-body'); + if (article) + article.firstChild.before(googleSearchToolLink(url)); + } + let article_lock = document.querySelector('div.article-lock'); + if (article_lock) { + let intro = article_lock.querySelector('div[role="paragraph"]'); + let intro_start; + if (intro) + intro_start = intro.innerText.substring(0, 25); + let scripts = document.querySelectorAll('script:not([src], [type])'); + let json_script; + let link_script; + let script_start = 'self.__next_f.push([1,"'; + for (let script of scripts) { + if (script.text.startsWith(script_start)) { + if (!link_script && script.text.includes('significantLink\\":')) + link_script = script; + else if (!json_script && (script.text.includes('[storyid:') || (intro_start && script.text.replace(/\\u003c/g, '<').replace(/\\u003e/g, '>').replace(/<[^<]*>\s?/g, '').replace(/\\"/g, '"').startsWith(script_start + intro_start)))) + json_script = script; + if (json_script && link_script) + break; + } + } + if (json_script) { + article_lock.classList.remove('article-lock'); + let banner = 'div.paywall-content'; + hideDOMStyle(banner); + let img_main = document.querySelector('div.story-gallery-main figure > img[src]'); + let links; + if (link_script) + links = link_script.text.split('significantLink\\":[')[1].split('\\"],')[0].replace(/\\"/g, '').split(','); + let json_pars = json_script.text.split('self.__next_f.push([1,"')[1].split('"])')[0].replace(/\\u003c/g, '<').replace(/\\u003e/g, '>').replace(/\\"/g, '"').replace(/
/g, '').split(/[\[\]]{2}/); + if (json_pars.length) { + article_lock.innerHTML = ''; + if (json_pars.find(x => x.includes('embed:') || x === 'gallery')) + addGST(); + } + let parser = new DOMParser(); + for (let elem of json_pars) { + let par; + if (!elem.match(/[\[\]]{2}/)) { + if (elem.match(/img:\d+/)) { + if (img_main) { + let img_new_id = elem.split('img:')[1]; + if (img_new_id) { + par = document.createElement('img'); + par.src = img_main.src.replace(/_\d+\./, '_' + img_new_id + '.').split('?')[0]; + par.style = 'margin: 20px; width: 90%;'; + } + } + } else if (elem.match(/storyid:\d+/)) { + if (links) { + let story_id = elem.split('storyid:')[1]; + if (story_id) { + let story = links.find(x => x.includes(story_id + '_')); + if (story) { + par = document.createElement('a'); + par.href = story; + par.innerText = story.split(story_id + '_')[1].replace(/_/g, ' ').replace('/', ''); + par.className = 'story-related'; + if (!matchUrlDomain(window.location.hostname, story)) + par.target = '_blank'; + } + } + } + } else if (!elem.match(/quote:\d+/)) { + let doc = parser.parseFromString('
' + elem + '
', 'text/html'); + par = doc.querySelector('div'); + } + if (par) + article_lock.appendChild(par); + } + } + } + } else + addGST(); + } + }, 1000); +} + +else if (matchDomain('dwell.com')) { + if (window.location.pathname.match(/^(\/amp)?\/article\//)) { + if (!window.location.search.startsWith('?rel=plus')) { + let paywall = pageContains('div > a', /Try Dwell\+ for FREE/); + if (paywall.length) { + removeDOMElement(paywall[0]); + window.location.href = window.location.pathname.replace(/^\/amp/, '') + '?rel=plus'; + } + } else { + let paywall = document.querySelector('div#mainPanel div[class^="FCR_"]'); + let article = document.querySelector('div > section[class]'); + if (paywall && article) { + removeDOMElement(paywall); + article.classList.remove('_2S7l9_l2eDI5b8DSR29ijf'); + let filter = /^window\.INITIAL_STATE\s?=\s?/; + let json_script = getSourceJsonScript(filter); + if (json_script) { + let split1 = json_script.text.split(filter)[1]; + let state = (split1.split('};')[0] + '}'); + if (state) { + try { + let json = JSON.parse(state); + if (json) { + let items = json.articles.items; + let id = Object.keys(items)[0]; + let photos = json.photos ? json.photos.items : ''; + let json_text = items[id].attributes.body.replace(/(
||<\/span>)/g, ''); + function find_img_url(match, p1, p2, offset, string) { + let contributorId; + let format; + if (photos && photos[p1]) { + contributorId = photos[p1].attributes.userId; + format = photos[p1].attributes.format; + } + let result = '

missing photo: ' + p1 + '

'; + if (contributorId) + result = '
' + p2 + '
'; + return result; + } + json_text = json_text.replace(//g, find_img_url); + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + json_text + '
', 'text/html'); + let article_new = doc.querySelector('section'); + article.parentNode.replaceChild(article_new, article); + } + } catch (err) { + console.log(err); + } + } + } + } + let photo_links = document.querySelectorAll('div > a[href^="' + window.location.pathname.replace(/\/\d{8,}/, '') + '"]'); + for (let elem of photo_links) + elem.href += '?rel=plus'; + let close_button = document.querySelector('header > div > span > svg'); + if (!document.querySelector('a#bpc_close') && close_button) { + let elem = document.createElement('a'); + elem.href = window.location.pathname.split('?')[0].replace(/\/\d{8,}/, ''); + elem.id = 'bpc_close'; + elem.innerText = 'close'; + elem.style.color = 'white'; + close_button.parentNode.parentNode.appendChild(elem); + } + } + } + let ads = 'div.EYrS5iukqzJMkNAcFQ0ho'; + hideDOMStyle(ads); +} + +else if (matchDomain('economictimes.com')) { + if (window.location.pathname.includes('/amp_')) { + let paywall = document.querySelector('.paywall_wrap'); + if (paywall) { + let content = document.querySelector('.paywall[style="display:none;"]'); + if (content) { + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + content.innerText + '
', 'text/html'); + let content_new = doc.querySelector('div'); + let charts = content_new.querySelectorAll('iframe[id^="datawrapper-chart-"]'); + for (let elem of charts) { + elem.width = '100%'; + elem.style.margin = '20px 0px'; + } + if (content_new && content.parentNode) + content.parentNode.replaceChild(content_new, content); + } else + window.location.href = 'https://economictimes.indiatimes.com' + window.location.pathname.replace('amp_prime', 'prime'); + let intro = document.querySelector('.art_wrap'); + let article_blocker = document.querySelector('.articleBlocker'); + removeDOMElement(paywall, intro, article_blocker); + let ads = 'amp-ad'; + hideDOMStyle(ads); + } + } else { + window.setTimeout(function () { + let paywall = document.querySelector('div#blocker_layer'); + let data_prime = document.querySelector('div[data-prime="1"]'); + let amphtml = document.querySelector('head > link[rel="amphtml"]'); + if (paywall || data_prime) { + removeDOMElement(paywall); + if (data_prime) + data_prime.removeAttribute('data-prime'); + if (amphtml) + amp_redirect_not_loop(amphtml); + else if (window.location.pathname.startsWith('/epaper/')) + window.location.href = 'https://economictimes.indiatimes.com' + window.location.pathname; + } else { + let ads = '.adContainer'; + hideDOMStyle(ads); + } + }, 500); + } +} + +else if (matchDomain('economictimes.indiatimes.com')) { + let paywall = document.querySelector('section.prime_paywall'); + if (paywall) { + removeDOMElement(paywall); + let content = document.querySelector('div.content1, div.artText'); + let full_text = document.querySelector('div.paywall.p1'); + if (content && full_text) { + if (!(full_text.innerText.includes('!function()') && full_text.innerText.includes('datawrapper-height'))) + content.innerText = full_text.innerText; + else { + let amphtml = document.querySelector('head > link[rel="amphtml"]'); + if (amphtml) + amp_redirect_not_loop(amphtml) + } + } + addStyle('div.pageContent {height: auto !important;}'); + let article_wrap = document.querySelector('div.article_wrap[style]'); + if (article_wrap) + article_wrap.removeAttribute('style'); + } + if (mobile) { + let pageholder = document.querySelector('main.pageHolder'); + if (pageholder) { + pageholder.classList.remove('pageHolder'); + let header = document.querySelector('header'); + if (header) + header.style = 'width: 100% !important;'; + let f_col = document.querySelector('div.f_col'); + removeDOMElement(f_col); + } + } + let ads = 'div.topAdContainer, div.vdo_ai_can_ani, div[data-ad-slot]'; + hideDOMStyle(ads); +} + +else if (matchDomain('economist.com')) { + if (window.location.pathname.includes('/podcasts/')) { + header_nofix('section[data-body-id]', 'div[aria-labelledby="paywall-heading"]'); + } else if (!window.location.pathname.startsWith('/interactive/')) { + let paywall_sel = 'div#tp-regwall'; + let article_sel = 'main'; + let video = document.querySelector('iframe[src^="https://www.youtube.com/"]'); + func_post = function () { + if (video) { + let video_new = document.querySelector('div[old-src^="https://www.youtube.com/"]'); + if (video_new && video_new.parentNode) + video_new.parentNode.replaceChild(video, video_new); + } + if (mobile) { + let grids = document.querySelectorAll('div[style*="grid-template-columns"]'); + for (let elem of grids) + elem.removeAttribute('style'); + let lazy_images = document.querySelectorAll('figure img[loading="lazy"][style]'); + for (let elem of lazy_images) + elem.style = 'width: 95%;'; + } + } + let url = window.location.href; + getArchive(url, paywall_sel, '', 'main'); + } + let ads = 'div[class*="adComponent"]'; + hideDOMStyle(ads); +} + +else if (matchDomain('enotes.com')) { + let paywall = document.querySelector('section#enotes-paywall'); + if (paywall) { + let section_words = pageContains('p', /\(This entire section contains/); + removeDOMElement(paywall, ...section_words); + setCookie('ENOTESID', '', 'enotes.com', '/', 0); + let blurred = document.querySelectorAll('div.u-paywall'); + for (let elem of blurred) + elem.className = 'o-rte-text u-space--top'; + let ads = document.querySelectorAll('div:not([class]) > div[id^="div-gpt-ad-"]'); + for (let ad of ads) + hideDOMElement(ad.parentNode); + } +} + +else if (matchDomain('entrepreneur.com')) { + let ads = 'div.ad__wrapper, div#piano-metered-container'; + hideDOMStyle(ads); +} + +else if (matchDomain('epoch.org.il')) { + getJsonUrl('div.register-login-box', '', 'div.paywall'); +} + +else if (matchDomain('espn.com')) { + let url = window.location.href; + getArchive(url, 'aside.espn-plus-container-wrapper', '', 'section#article-feed > article'); +} + +else if (matchDomain('euobserver.com')) { + let paywall = pageContains('div > h4', 'To read this story, log in or subscribe'); + if (paywall.length) { + removeDOMElement(paywall[0].parentNode); + let article = document.querySelector('div:has(> p.rte-p)'); + if (article) { + let filter = /^window\.__basedcache__\s?=\s?/; + let json_script = getSourceJsonScript(filter); + if (json_script) { + try { + let json = JSON.parse(json_script.text.split(filter)[1]); + if (json) { + let body = findKeyJson(json, ['body']); + if (body) { + article.innerHTML = ''; + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + body + '
', 'text/html'); + let article_new = doc.querySelector('div'); + article.appendChild(article_new); + } + } + } catch (err) { + console.log(err); + } + } + } + } +} + +else if (matchDomain('fastcompany.com')) { + let paywall = document.querySelector('div.paywall'); + if (paywall) { + removeDOMElement(paywall); + let filter = /\\"content\\":\[/; + let json_script = getSourceJsonScript(filter, ':not([id], [src], [type])'); + if (json_script) { + try { + let json = JSON.parse('[' + json_script.text.split(filter)[1].split(/\],\\"/)[0].replace(/\\\\\\"/g, '\\"').replace(/(\[|,)\\"/g, '$1"').replace(/\\"(\]|,)/g, '"$1').replace(/\\\\n/g, '') + ']'); + if (json) { + let article = document.querySelector('article'); + if (article) { + article.innerHTML = ''; + article.className = 'article-container'; + let parser = new DOMParser(); + for (let pars of json) + for (let par of pars) { + if (!par.match(/^\$\w{2}$/)) { + let content_new = parser.parseFromString('
' + par + '
', 'text/html'); + let elem = content_new.querySelector('div'); + let img_srcset_drop = elem.querySelectorAll('figure > img[srcset]'); + for (let img of img_srcset_drop) + img.removeAttribute('srcset'); + article.appendChild(elem); + } + } + } + } + } catch (err) { + console.log(err); + } + } + } + let ads = 'div[class*="ad-wrapper"]'; + hideDOMStyle(ads); +} + +else if (matchDomain('fieldandstream.com')) { + let overlay = document.querySelectorAll('div[class^="mailmunch-"]'); + removeDOMElement(...overlay); + let noscroll = document.querySelector('html.mailmunch-pop-open'); + if (noscroll) + noscroll.removeAttribute('class'); +} + +else if (matchDomain('financialexpress.com')) { + let paywall = document.querySelector('div.paywall'); + if (paywall) + paywall.classList.remove('paywall'); + let register = 'div.pcl-wrap'; + let ads_selector = window.location.pathname.endsWith('/lite/') ? '.ad-bg-container' : 'div[class*="-ads-blocks-ad-unit"]'; + hideDOMStyle(register + ', ' + ads_selector); +} + +else if (matchDomain('fmrmagazine.com')) { + let paywall = document.querySelector('div.fr-gate-overlay'); + if (paywall) { + removeDOMElement(paywall); + let article = document.querySelector('div.issue-article-intro'); + if (article) { + let url_src = window.location.href.split(/[#\?]/)[0] + '.json'; + fetch(url_src) + .then(response => { + if (response.ok) { + response.json().then(json => { + try { + let json_text = json.page.body_html; + if (json_text) { + let parser = new DOMParser(); + let doc = parser.parseFromString(json_text, 'text/html'); + let article_new = doc.querySelector('div.issue-article-content'); + if (article_new) + article.after(article_new); + addStyle('body {overflow: auto !important;}'); + } + } catch (err) { + console.log(err); + } + }); + } + }) + } + } +} + +else if (matchDomain('forbes.com')) { + waitDOMAttribute('html', 'HTML', 'class', node => node.removeAttribute('class'), true); + waitDOMAttribute('body', 'BODY', 'class', node => node.removeAttribute('class'), true); + if (window.location.pathname.startsWith('/newsletters/')) { + let paywall = document.querySelector('div > div.newsletter-teaser'); + if (paywall) { + paywall.classList.remove('newsletter-teaser'); + let header = paywall.parentNode; + header_nofix(header); + } + } + let ads = 'fbs-ad, div[class^="fbs-ad"], div[data-testid^="fbs-ad"], div.inlineAdContainer, div[data-testid="locked-top-ad-container"]'; + hideDOMStyle(ads); +} + +else if (matchDomain('forbes.ua')) { + let paywall = document.querySelector('div.js-closed-part'); + if (paywall) { + removeDOMElement(paywall); + let json_script = getArticleJsonScript(); + if (json_script) { + let json = JSON.parse(json_script.text); + if (json) { + let json_text = parseHtmlEntities(json.articleBody).replace(/\n/g, "$&\r\n"); + let article = document.querySelector('div.c-post-text'); + if (json_text && article) + article.innerText = json_text; + } + } + } +} + +else if (matchDomain('foreignaffairs.com')) { + let paywall = document.querySelector('.paywall'); + let loading_indicator = document.querySelector('.loading-indicator'); + let msg_bottom = document.querySelector('.messages--container--bottom'); + removeDOMElement(paywall, loading_indicator, msg_bottom); + let article_dropcap = document.querySelectorAll('.article-dropcap'); + for (let elem of article_dropcap) + elem.classList.add('loaded'); +} + +else if (matchDomain('foreignpolicy.com')) { + let content_ungated = document.querySelector('div.content-ungated'); + if (content_ungated) { + removeDOMElement(content_ungated); + let content_gated = document.querySelector('div.content-gated'); + if (content_gated) { + let insider = document.querySelector('body.is-fp-insider'); + if (insider) { + getJsonUrl('div.content-gated', {rm_class: 'content-gated'}, 'div.content-gated'); + window.setTimeout(function () { + let lazy_images = document.querySelectorAll('img[loading="lazy"]'); + for (let elem of lazy_images) + elem.removeAttribute('loading'); + }, 1000); + } else + content_gated.classList.remove('content-gated'); + } + } +} + +else if (matchDomain('fortune.com')) { + setCookie(['xbc', 'pcid'], '', 'fortune.com', '/', 0); + let paywall = document.querySelector('div.paywallActive'); + if (paywall) + paywall.removeAttribute('class'); + let banners = 'div.tp-container-inner, div[class^="sc-"]:has( > div[data-cy="leaderboard"]), div[class^="sc-"]:has( > div.nativo-tout)'; + hideDOMStyle(banners); +} + +else if (matchDomain('foxnews.com')) { + let paywall = document.querySelector('div.article-gating-wrapper'); + removeDOMElement(paywall); + let overlay = document.querySelector('div[class*="gated-overlay"]'); + if (overlay) + overlay.removeAttribute('class'); +} + +else if (matchDomain('ftm.eu')) { + let videos = document.querySelectorAll('div.body > div.video-pp'); + for (let video of videos) { + let video_id_dom = video.querySelector('a.video[data-youtube-id]'); + if (video_id_dom) { + video_new = document.createElement('iframe'); + video_new.src = 'https://www.youtube.com/embed/' + video_id_dom.getAttribute('data-youtube-id'); + video_new.style = 'width: 95%; height: 400px; margin: 0px 20px;'; + video.parentNode.replaceChild(video_new, video); + } + } + let audio_controls = document.querySelectorAll('audio[controls][style]'); + for (let elem of audio_controls) + elem.removeAttribute('style'); + document.querySelectorAll('div.foldable').forEach(e => e.classList.remove('foldable')); + let banners = 'div.banner-pp'; + hideDOMStyle(banners); +} + +else if (matchDomain(['haaretz.co.il', 'haaretz.com', 'themarker.com'])) { + if (window.location.pathname.match(/\/ty-article/)) { + let body_wrapper_sel = 'section[data-testid="article-body-wrapper"]'; + let paywall_sel = 'div[data-test="paywallMidpage"], ' + body_wrapper_sel + ' div[data-testid="logo-loading-indicator"]'; + let article_sel = 'main'; + let article_link_sel = 'main header, main.article-page p:not([id]), h1#article-header, ' + body_wrapper_sel; + let url = window.location.href; + if (!mobile) { + func_post = function () { + let disabled_items = 'section[data-testid="zoidberg-list"], section#comments-section, div[old-position="sticky"]'; + hideDOMStyle(disabled_items); + } + getArchive(url, paywall_sel, '', article_sel, '', article_sel, article_link_sel); + } else { + let paywall = document.querySelector(paywall_sel); + if (paywall) { + removeDOMElement(paywall); + let article_link = document.querySelector(article_link_sel); + if (article_link) + article_link.before(archiveLink(url)); + } + } + } + let history_keys = Object.keys(window.localStorage).filter(x => x.match(/^(reading(Count)?History|raData)/i)); + for (let item of history_keys) + window.localStorage.removeItem(item); +} + +else if (matchDomain('harpers.org')) { + setCookie('hr_session', '', 'harpers.org', '/', 0); + let paywall = document.querySelector('div#full-paywall'); + if (paywall) { + paywall.removeAttribute('id'); + header_nofix(paywall, '', 'BPC > no fix (for older articles archive may work)'); + let url = window.location.href; + paywall.before(archiveLink(url)); + } + let ads = 'div#ctas'; + hideDOMStyle(ads); +} + +else if (matchDomain('hbr.org')) { + if (window.location.pathname.startsWith('/data-visuals')) { + let feed_entries = document.querySelectorAll('li.feed-entry'); + for (let feed_entry of feed_entries) { + let download = feed_entry.querySelector('span.entry-download > a[href*="/undefined/"]'); + if (download) { + let figure = feed_entry.querySelector('figure.entry-image > img[src]'); + if (figure) { + download.href = figure.src; + download.setAttribute('download', ''); + } + } + } + } else { + function hbr_main() { + window.top.postMessage({type: 'article-paywall:full-content'}, '*'); + } + let popup = document.querySelector('.persistent-banner'); + removeDOMElement(popup); + let paywall = document.querySelector('div[id^="paywall"]'); + if (paywall) { + removeDOMElement(paywall); + insert_script(hbr_main); + } + } +} + +else if (matchDomain('hilltimes.com')) { + function hilltimes_main(node) { + getJsonUrl('div.paywallcont', '', 'div#entry-content'); + } + let paywall_sel = 'div.paywallcont'; + let paywall = document.querySelector(paywall_sel); + if (true) { + if (paywall) + hilltimes_main(paywall); + else + waitDOMElement(paywall_sel, 'DIV', hilltimes_main, false); + } + let banner = 'section.hide_this_section'; + hideDOMStyle(banner); +} + +else if (matchDomain('hindustantimes.com')) { + document.querySelectorAll('.freemiumText').forEach(e => e.classList.remove('freemiumText')); + let noscroll = document.querySelector('body.open-popup'); + if (noscroll) + noscroll.classList.remove('open-popup'); + let banners = 'div[class^="sub-paywall-version"], div[class^="adHeight"], .closeStory'; + hideDOMStyle(banners); +} + +else if (matchDomain('historyextra.com')) { + let article_masked = document.querySelector('.template-article__masked'); + if (article_masked) { + let extra_pars = document.querySelectorAll('div.template-article__masked > p'); + removeDOMElement(...extra_pars); + article_masked.classList.remove('template-article__masked'); + } + let ads = 'div.ad-slot, div.ad-banner, div.stitcher-ad--dai-placeholder'; + hideDOMStyle(ads); +} + +else if (matchDomain('historytoday.com')) { + if (window.location.hostname.startsWith('app.')) { + restorePugpigPage(); + } else { + let paywall = document.querySelector('div.nopremium-message'); + if (paywall) { + let app_link = document.createElement('a'); + let app_url = 'app.historytoday.com'; + app_link.href = 'https://' + app_url; + app_link.innerText = 'BPC > no fix, search article on: ' + app_url; + app_link.style = 'color: red; font-weight: bold;'; + let app_div = document.createElement('div'); + app_div.style = 'margin: 20px;'; + app_div.appendChild(app_link); + paywall.before(app_div); + removeDOMElement(paywall); + } + } +} + +else if (matchDomain('inc.com')) { + let paywall = document.querySelector('div.paywall'); + if (paywall) { + removeDOMElement(paywall); + let locked = document.querySelector('div.article-container--locked'); + if (locked) + locked.className = 'article-container'; + } + let ads = 'div.second-scroll-border'; + hideDOMStyle(ads); +} + +else if (matchDomain('inc42.com')) { + if (window.location.pathname.endsWith('/amp/')) { + amp_unhide_access_hide('="status"', '="NOT status"', 'div.wru-widget'); + } else { + let banner = document.querySelector('div[id*="_leaderboard_"]'); + removeDOMElement(banner); + } +} + +else if (matchDomain('indianexpress.com')) { + if (window.location.pathname.endsWith('/lite/')) + amp_unhide_access_hide('="metering.result=\'ALLOW_ACCESS\'"'); + else { + let ads = 'div[class^="adsbox"], div.adboxtop, div.add-first, div.osv-ad-class, div.ie-int-campign-ad'; + hideDOMStyle(ads); + } +} + +else if (matchDomain('indiatoday.in')) { + if (window.location.pathname.match(/(\/amp)?\/magazine\//)) { + let url = window.location.href; + if (!url.includes('/amp/')) { + amp_redirect('div#csc-paywall'); + } else { + amp_unhide_access_hide('="granted"', '="NOT NOT granted"', 'div[class^="wrapper_main-container_"], div.readmore__box'); + } + } +} + +else if (matchDomain('infzm.com')) { + let url = window.location.href; + if (url.includes('.com/wap/#/content/')) { + let container = document.querySelector('section.container'); + if (container) + container.classList.remove('container'); + let overlay = document.querySelector('div.article-content[style]'); + if (overlay) + overlay.removeAttribute('style'); + } else if (url.includes('.com/contents/')) { + let paywall = document.querySelector('div.nfzm-article-jumbotron--unauth'); + if (paywall) { + removeDOMElement(paywall); + window.location.href = url.replace('.com/contents/', '.com/wap/#/content/').split('?')[0]; + } + } +} + +else if (matchDomain('inkl.com')) { + let url = window.location.href; + if (url.includes('/signin?') && url.includes('redirect_to=')) { + window.setTimeout(function () { + window.location.href = 'https://www.inkl.com' + decodeURIComponent(url.split('redirect_to=')[1]); + }, 500); + } else { + let paywall = document.querySelector('div.paywall'); + if (paywall) { + paywall.removeAttribute('class'); + let gradient_container = document.querySelector('div.gradient-container'); + removeDOMElement(gradient_container); + } + let what_is_inkl = document.querySelector('.what-is-inkl-container, .features-panel'); + let signup = document.querySelectorAll('.article-signup-container, .locked-sign-up-container, div[class*="/inkl-watermark.svg"]'); + let shared_banner = document.querySelector('div.shared-article-inline-banner'); + removeDOMElement(what_is_inkl, ...signup, shared_banner); + let dismiss_button = document.querySelector('div.dismiss-button-container button.btn'); + if (dismiss_button) + dismiss_button.click(); + let dive_deeper_summary_bodies = document.querySelectorAll('div.dive-deeper-container div.summary-body'); + if (dive_deeper_summary_bodies) { + for (let summary_body of dive_deeper_summary_bodies) { + if (!summary_body.querySelector('a')) { + let ng_click = summary_body.getAttribute('ng-click').replace("showArticle('", '').replace("')", ''); + let weblink = document.createElement('a'); + weblink.text = 'open'; + weblink.href = 'https://www.inkl.com/news/' + ng_click; + summary_body.appendChild(weblink); + } + } + } + } +} + +else if (matchDomain('insidehighered.com')) { + let ads = 'div[id^="block-dfptag"], div.wp-block-ihe-ad, section.section-ad_slot, div#roadblock'; + hideDOMStyle(ads); +} + +else if (matchDomain('interestingengineering.com')) { + addStyle('body {overflow: auto !important; position: relative !important; top: unset !important;}'); + let banners = 'main > div[class*="t-hidden"], div.t-bg-black'; + hideDOMStyle(banners); +} + +else if (matchDomain('ipolitics.ca')) { + let login = document.querySelector('div.login'); + if (login) { + removeDOMElement(login); + let json_script = document.querySelector('script#__NEXT_DATA__'); + if (json_script) { + try { + let json = JSON.parse(json_script.innerText); + if (json && json.props.pageProps.post && json.props.pageProps.post.content) { + let url_next = json.props.pageProps.post.slug; + if (url_next && !window.location.pathname.includes(url_next)) + refreshCurrentTab(); + let article_new = json.props.pageProps.post.content; + let article = document.querySelector('.post-body'); + if (article) { + article.innerHTML = ''; + article.classList.remove('locked'); + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + article_new + '
', 'text/html'); + let content_new = doc.querySelector('div'); + article.appendChild(content_new); + } + } else { + refreshCurrentTab(); + } + } catch (err) { + console.log(err); + } + } + } +} + +else if (matchDomain('japantimes.co.jp')) { + setCookie('xbc', '', 'japantimes.co.jp', '/', 0); + let url = window.location.href; + getArchive(url, 'div.blocker', '', 'div#jtarticle'); + let banner = document.querySelector('div.subscribe'); + removeDOMElement(banner); + let ads = 'div.DisplayAd'; + hideDOMStyle(ads); +} + +else if (matchDomain('jpost.com')) { + let premium_banners = document.querySelectorAll('.hide-for-premium, #hiddenPremiumForm, #hiddenLink'); + removeDOMElement(...premium_banners); +} + +else if (matchDomain('kathimerini.gr')) { + let ads = 'div.nx-billboard-ad-row'; + hideDOMStyle(ads); +} + +else if (matchDomain('kompas.id')) { + let url_artikel = window.location.pathname.startsWith('/artikel/'); + let delay = url_artikel ? 2500 : 0; + window.setTimeout(function () { + let paywall = document.querySelector('kompasid-paywall'); + if (paywall) { + removeDOMElement(paywall); + if (url_artikel) { + let intro = document.querySelector('div.paywall'); + removeDOMElement(intro); + let art_hidden = document.querySelector('div.non-paywall[style]'); + if (art_hidden) + art_hidden.removeAttribute('style'); + } else { + let art_hidden = document.querySelector('section.paywall.hidden'); + if (art_hidden) + art_hidden.classList.remove('hidden'); + } + } + }, delay); +} + +else if (matchDomain('latimes.com')) { + let subscribers = pageContains('div.infobox > p.infobox-title', /subscribers/i); + if (subscribers.length) + removeDOMElement(subscribers[0].parentNode); + let ads = 'div.google-dfp-ad-wrapper, div.revcontent'; + hideDOMStyle(ads); +} + +else if (matchDomain('law.com')) { + func_post = function () { + let pars = document.querySelectorAll(article_sel + ' div[style*="font-family:"]'); + if (pars.length < 5) + pars[0].after(googleSearchToolLink(url)); + let banner = document.querySelector(article_sel + ' div > div > div > a[href="https://store.law.com/Registration/default.aspx"]'); + if (banner) + removeDOMElement(banner.parentNode.parentNode.parentNode); + } + let url = window.location.href; + let paywall_sel = 'div.paywall-content'; + let article_sel = 'main:not(:has(main))'; + let paywall = document.querySelector(paywall_sel); + if (paywall) { + let podcast = document.querySelector('article > a[href="/podcast/"]'); + if (podcast) + paywall.removeAttribute('class'); + else + getArchive(url, paywall_sel, {rm_atrrib: 'class'}, article_sel); + } +} + +else if (matchDomain('livelaw.in')) { + let amp = window.location.pathname.startsWith('/amp/'); + let paywall = document.querySelector(amp ? 'div.subscribeNow' : 'div#subscription_paid_message'); + if (paywall) { + let intro = document.querySelector(amp ? 'div.story' : 'div.details-story-wrapper'); + removeDOMElement(paywall, intro); + let paywall_content = document.querySelector('div.paywall-content.hide'); + if (paywall_content) + paywall_content.className = amp ? '' : 'news_details_page_row2 details-story-wrapper'; + } + let ads = 'inside-post-ad, amp-ad'; + hideDOMStyle(ads); +} + +else if (matchDomain('livemint.com')) { + if (window.location.pathname.includes('/amp-')) { + let paywall = document.querySelectorAll('[amp-access="NOT subscribed"]'); + removeDOMElement(...paywall); + } else { + let paywall = document.querySelector('div.paywall'); + if (paywall) + paywall.classList.remove('paywall'); + let banners = document.querySelectorAll('div[class^="storyPaywall_paywallStory_"]'); + removeDOMElement(...banners); + let ads = '[class^="ad"], [id^="ad"], #subscribeAd, .taboolaHeight'; + hideDOMStyle(ads); + } +} + +else if (matchDomain('magazine.atavist.com')) { + let bottom_notification = document.querySelector('div.bottom-notification'); + let overlay = document.querySelector('div.notification-overlay'); + removeDOMElement(bottom_notification, overlay); + let paywall = document.querySelector('body.paywall-notification-visible'); + if (paywall) + paywall.classList.remove('paywall-notification-visible'); + window.localStorage.clear(); +} + +else if (matchDomain('manoramaonline.com')) { + if (!window.location.pathname.endsWith('.amp.html')) { + amp_redirect('ev-engagement'); + } else { + amp_unhide_access_hide("=\"result='ALLOW_ACCESS'\""); + } +} + +else if (matchDomain('marketwatch.com')) { + if (window.location.pathname.startsWith('/livecoverage/')) { + window.setTimeout(function () { + fix_dowjones_live(); + }, 1500); + } else { + let paywall = document.querySelector('div#cx-snippet-container'); + if (paywall) { + removeDOMElement(paywall); + window.setTimeout(function () { + let article_sel = 'section[class*="-Container"]'; + let article = document.querySelector(article_sel); + if (article) { + addStyle(article_sel + '::after {background: none !important;}'); + let article_id_dom = document.querySelector('head > meta[name="article.id"][content]'); + if (article_id_dom) { + let article_id = article_id_dom.content; + let url_src = 'https://mwatch.djmedia.djservices.io/apps/marketwatch/theaters/article?screen_ids=' + article_id; + let x_access_token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJBVVRIX1BIUkFTRV9QUk9EX0FORFJPSUQiOiJjWXhLbURPOENOcm9wOEZINmtkTyJ9.xozUBM2fH4fY5JvdSrpvesZHeNFqS9aIFSZdXsvty5tgE1qb5w26I5Fe-FGQTYQdfPCQmJ60dh-QsxPKmsm3J0l50zF5CiiTAzmvD5D_XWkV_sa_L5eMqLvLyV2Wcrld9-LhKfmyqQlqDSU79276_sgo6yxDA2xqKDzFzwoOj3OILFKdkXvZNbN9NGapoTEV6z8CWt2nOxnBsN-_cXjpeDE_Al2EgWtSLA32nlRcbJ9Nm4ZRpZzCr5AKaUtysnjiAFpWyp1MSnYMJEZImYbt7nm9k2qd3ResXx0vZu-PZkr9bi4zprCUmvbLzopRbVbDwcDJowWpwyo3DnrjOhBKgw"; + getExtFetch(url_src, '', {"app-identifier": "com.news.screens", "device-type": "phone", "x-access-token": x_access_token}, fix_dowjones_fetch, [article]); + } + } + }, 2000); + } + } + let ads = 'div.element--ad, div.j-ad, div.adWrapper, div#cx-articlecover'; + hideDOMStyle(ads); +} + +else if (matchDomain('medscape.com')) { + let ads = '.AdUnit, [id^="ads-"]'; + hideDOMStyle(ads); +} + +else if (matchDomain('mexiconewsdaily.com')) { + let div_hidden = document.querySelector('body.single div.td-post-content > div.tdb-block-inner'); + if (div_hidden) + div_hidden.classList.remove('tdb-block-inner'); +} + +else if (matchDomain('mid-day.com')) { + if (window.location.pathname.startsWith('/amp/')) { + amp_unhide_access_hide('="granted"', '="NOT granted"', '[class*="BannerAd"], div.midday-wrapper'); + } else { + amp_redirect('div#myModalFullscreen'); + let read_more = document.querySelector('#read-more-my'); + if (read_more) + read_more.click(); + } +} + +else if (matchDomain('mnimarkets.com')) { + let paywall = document.querySelector('div.missing-out-overlay'); + if (paywall) { + removeDOMElement(paywall); + let article = document.querySelector('div.body-html'); + if (article) { + let twitter_description = document.querySelector('head > meta[name="twitter:description"][content]'); + if (twitter_description && twitter_description.content.length > 200) { + let par = article.querySelector('p'); + if (par) + par.innerText = parseHtmlEntities(twitter_description.content); + } else { + let intro_start = article.innerText.substring(0, 25); + let scripts = document.querySelectorAll('script:not([src], [type])'); + let json_script; + let script_start = 'self.__next_f.push([1,"'; + for (let script of scripts) { + if (script.text.startsWith(script_start)) { + if (intro_start && script.text.replace(/\\n/g, ' ').startsWith(script_start + intro_start)) { + json_script = script; + break; + } + } + } + if (json_script) { + let json_text = json_script.text.split('self.__next_f.push([1,"')[1].split('"])')[0].replace(/\\n\\n/g, '\r\n\r\n').replace(/\\n/g, ' ').replace(/\\"/g, '"').replace(/\\u0026/g, '&'); + let article_new = document.createElement('p'); + article_new.innerText = parseHtmlEntities(json_text); + article.innerHTML = ''; + article.appendChild(article_new); + } + } + } + } + let body = document.querySelector('body'); + if (body) + body.style = 'user-select: text !important'; +} + +else if (matchDomain('nationalgeographic.com')) { + function natgeo_func(node) { + removeDOMElement(node); + let body = document.querySelector('body[class]'); + if (body) { + body.removeAttribute('class'); + body.removeAttribute('style'); + } + } + let paywall = document.querySelector('div[id^="fittPortal"]'); + if (paywall) + natgeo_func(paywall); + waitDOMElement('div[id^="fittPortal"]', 'DIV', natgeo_func, false); + window.setTimeout(function () { + let url = window.location.href; + let subscribed = document.querySelector('div.Article__Content--gated'); + let msg = document.querySelector('div#bpc_archive'); + if (subscribed && !msg) { + subscribed.appendChild(archiveLink(url)); + subscribed.setAttribute('style', 'overflow: visible !important;'); + } + let overlay = document.querySelector('div.Article__Content__Overlay--gated'); + if (overlay) + overlay.classList.remove('Article__Content__Overlay--gated'); + }, 2000); + let ads = 'div.ad-slot, div.InsertedAd, div.natgeo-ad'; + hideDOMStyle(ads); +} + +else if (matchDomain('nationalreview.com')) { + if (!window.location.pathname.endsWith('/amp/')) { + let paywall_sel = 'div.continue-reading'; + let paywall = document.querySelector(paywall_sel); + if (paywall) { + let amphtml = document.querySelector('head > link[rel="amphtml"][href]'); + if (amphtml && !amphtml.href.includes(window.location.pathname)) { + removeDOMElement(paywall); + refreshCurrentTab(); + } else + getJsonUrl(paywall_sel, '', 'div.article-content', {art_class: 'article-content article-content--headless'}); + } + } + let banners = 'div.zephr-wrapper, div#bc-root, div.cookie-text'; + let ads = 'amp-ad, .ad-unit, .ad-skeleton, amp-connatix-player, div[class*="-connatix-"]'; + hideDOMStyle(banners + ', ' + ads); +} + +else if (matchDomain('nature.com')) { + func_post = function () { + header_nofix('article', 'h2#access-options', 'BPC > no archive-fix'); + } + let url = window.location.href; + getArchive(url, 'div.app-access-wall, h2#access-options', '', 'article'); +} + +else if (matchDomain('nautil.us')) { + window.setTimeout(function () { + let adm_button = document.querySelector('div[class^="a__sc-np"] button'); + if (adm_button) + adm_button.click(); + }, 500); + let ads = 'div.article-ad'; + hideDOMStyle(ads); +} + +else if (matchDomain('ndtvprofit.com')) { + if (window.location.pathname.startsWith('/amp/')) { + amp_unhide_subscr_section(); + } else { + window.setTimeout(function () { + amp_redirect('div[class^="hard-paywall"], div[class*="geotag-container_"]'); + }, 1000); + } + let ads = 'div.responsive-ad'; + hideDOMStyle(ads); +} + +else if (matchDomain('newcriterion.com')) { + getJsonUrl('div.paywall-overlay', '', 'div.entry-content'); +} + +else if (matchDomain('newrepublic.com')) { + let modal = document.querySelector('div.article-scheduled-modal'); + let pw_popups = document.querySelector('div#pwPopups'); + removeDOMElement(modal, pw_popups); + let ads = '.ad-unit'; + hideDOMStyle(ads); +} + +else if (matchDomain('newscientist.com')) { + if (!window.location.hostname.startsWith('appan.')) { + let paywall = document.querySelector('section#subscription-barrier'); + if (paywall) { + removeDOMElement(paywall); + let json_script = document.querySelector('script#ns-seo-schema'); + if (json_script) { + try { + let json = JSON.parse(json_script.text); + if (json && json.datePublished) { + let date = json.datePublished.split(/T\d/)[0].replace(/-/g, '/'); + let path_new = window.location.pathname.split(/\/article\/(\d+-|mg\d+-\d+-)/)[2]; + if (path_new) { + let url = 'https://appan.newscientist.com/' + date + '/' + path_new + 'content.html'; + func_post = function () { + let lazy_images = document.querySelectorAll('img[src^="../"][data-src]'); + for (let elem of lazy_images) { + elem.src = elem.getAttribute('data-src'); + elem.removeAttribute('height'); + elem.removeAttribute('width'); + } + let videos = document.querySelectorAll('figure > div.pugpig-video[data-video-url]'); + for (let elem of videos) { + let iframe = document.createElement('iframe'); + iframe.src = elem.getAttribute('data-video-url'); + iframe.style = 'width: 100%; height: 400px; margin: 20px 0px;'; + elem.parentNode.replaceChild(iframe, elem); + } + } + replaceDomElementExt(url, false, false, 'section.ArticleContent', 'BPC > no fix (source file)', 'section[class$="-article__body"]'); + } + } + } catch (err) { + console.log(err); + } + } + } + let ads = 'div[class*="Advert"]'; + hideDOMStyle(ads); + } else { + restorePugpigPage(); + } +} + +else if (matchDomain('newsday.com')) { + let listen_button = document.querySelector('div.listen-button > button[disabled]'); + if (listen_button) { + let audio_src_dom = listen_button.parentNode.querySelector('audio > source[src]'); + if (audio_src_dom) { + let audio = document.createElement('audio'); + audio.src = audio_src_dom.src; + audio.setAttribute('controls', ''); + listen_button.parentNode.replaceChild(audio, listen_button); + } + } + let nd_lock = document.querySelector('html[class]'); + if (nd_lock) + nd_lock.removeAttribute('class'); + let ads = 'div.ad'; + hideDOMStyle(ads); +} + +else if (matchDomain('newslaundry.com')) { + let paywall = document.querySelector('div > div > img[alt^="paywall"]'); + if (paywall) { + let banner = document.querySelector('div.FrsvM'); + removeDOMElement(paywall.parentNode.parentNode, banner); + let json_script = getArticleJsonScript(); + if (json_script) { + let json = JSON.parse(json_script.text); + if (json) { + let json_text = parseHtmlEntities(json.articleBody).replace(/<\/p>\./g, '

'); + let article = document.querySelector('div.story-element-text'); + if (json_text && article) { + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + json_text + '
', 'text/html'); + let article_new = doc.querySelector('div'); + article.innerHTML = ''; + article.appendChild(article_new); + } + } + } + let video = document.querySelector('a:has(figure)'); + if (video) { + let scripts = document.querySelectorAll('script[type="application/ld+json"]'); + let video_script; + for (let script of scripts) { + if (script.innerText.includes('"embedUrl":"')) { + video_script = script; + break; + } + } + if (video_script) { + let video_new = document.createElement('iframe'); + video_new.src = video_script.innerText.split('"embedUrl":"')[1].split('"')[0]; + video_new.style = 'width: 100%; aspect-ratio: 16 / 9;'; + video_new.setAttribute('frameborder', 0); + video.parentNode.replaceChild(video_new, video); + } + } + } +} + +else if (matchDomain('newsweek.com')) { + let ads = 'div#topad, div[id^="dfp-ad-"]'; + hideDOMStyle(ads); +} + +else if (matchDomain(['nola.com', 'shreveportbossieradvocate.com', 'theadvocate.com'])) { + if (window.location.pathname.endsWith('.amp.html')) { + let body_hidden = document.querySelector('.site-container'); + if (body_hidden) + body_hidden.setAttribute('style', 'display:block;'); + } else { + let ads = 'div.tnt-ads-container, div.asset-breakout-ads'; + hideDOMStyle(ads); + } +} + +else if (matchDomain('nv.ua')) { + if (!window.location.pathname.includes('/amp/')) { + amp_redirect('div[id^="media_paywall"]'); + } else { + let paywall = document.querySelector('div.paywall-area'); + if (paywall) { + paywall.removeAttribute('class'); + let subscr = paywall.querySelector('div.make-subscription'); + removeDOMElement(subscr); + } + let article = document.querySelector('div.article__content'); + if (article) + article.removeAttribute('class'); + } +} + +else if (matchDomain('nybooks.com')) { + let paywall_article = document.querySelector('.paywall-article'); + if (paywall_article) + paywall_article.classList.remove('paywall-article'); + let banners = 'div.toast-cta, div.inline-ad'; + hideDOMStyle(banners); +} + +else if (matchDomain('nypost.com')) { + if (window.location.pathname.includes('/sports/')) { + let paywall = document.querySelectorAll('head > meta[content*="Sports Plus"]'); + if (paywall.length) { + removeDOMElement(...paywall); + let article_sel = 'div.single__content'; + let article = document.querySelector(article_sel); + if (article) { + article.classList.remove('entry-content-exclusive-covered'); + let json_url_dom = document.querySelector('head > link[rel="alternate"][type="application/json"][href]'); ; + if (json_url_dom) { + let match = json_url_dom.href.match(/\d+$/); + if (match) { + let footer = article.querySelector('div.single__footer'); + let article_id = match[0]; + let url_src = 'https://nypost.nypost.djservices.io/apps/nypost-v3/theaters/sports?screen_ids=' + article_id; + let x_access_token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJBVVRIX1BIUkFTRV9QUk9EX0FORFJPSUQiOiJGNGYzYnhzZGlIa1M1QzVIWUxUNSJ9.OGooBqisVQznx2FDxZpHAqWu-oG1wPJLUxYBMd3xOKiLakoR2XQC2hXnyS3zb1Dw6AkKcMhWyZfRerUckFjga8Ii59lZtP8Xt92iCUyJjs0yjmLJgkZWEGqZ8szM2UK7jZJ5SsHaYfe2V3c7KrtfbY74aWGwddvg-Ex4O5hwv3aiAJpI_aZMFqniClGM2pYbGNSPxH-I0PMuwTzt-oyofhQsRJWOQES8fmQz1H-opqQVr3B0-ev4MxYZjfk8kKnXxRbf7tDbQvastQh8kLe3KN90ptSp_LWbkPgo0G8Vw9Jzxy1TUd_VNgTE21uNdRAoZbxDly7aw-9CTDtb1OtXVg"; + getExtFetch(url_src, '', { + "app-identifier": "com.news.screens", + "device-type": "phone", + "x-access-token": x_access_token + }, fix_dowjones_fetch, data_ext_fetch_id++, [article]); + article.querySelectorAll('p[class]').forEach(e => e.removeAttribute('class')); + if (footer) { + window.setTimeout(function () { + article.appendChild(footer); + }, 1000); + } + } + } + } + } + } + let ads = 'div.ad'; + hideDOMStyle(ads); +} + +else if (matchDomain('nytimes.com')) { + if (!window.location.pathname.startsWith('/athletic/')) { + waitDOMElement('div#dock-container', 'DIV', removeDOMElement, false); + let ads = 'div[data-testid="inline-message"], div[id^="ad-"], div.pz-ad-box, div[class^="css-"]:has( > div#top-wrapper)'; + hideDOMStyle(ads); + } +} + +else if (matchDomain('outlookbusiness.com')) { + let paywall = document.querySelector('div#csc-paywall'); + if (paywall) { + removeDOMElement(paywall); + let json_script = document.querySelector('script#__NEXT_DATA__'); + if (json_script) { + let json = JSON.parse(json_script.innerText); + if (json && json.props.initialState.dashboard.ARTICLE_POST_DETAIL_API.data.article_data.description) { + let article_new = json.props.initialState.dashboard.ARTICLE_POST_DETAIL_API.data.article_data.description; + let article = document.querySelector('div.story-content'); + if (article) { + article.innerHTML = ''; + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + article_new + '
', 'text/html'); + let content_new = doc.querySelector('div'); + article.appendChild(content_new); + } + } + } + } +} + +else if (matchDomain('outlookindia.com')) { + let paywall = document.querySelector('div.paywall'); + if (paywall) { + removeDOMElement(paywall); + let json_script = getArticleJsonScript(); + if (json_script) { + let json = JSON.parse(json_script.text); + if (json) { + let json_text = parseHtmlEntities(json.articleBody).replace(/\n/g, "$&\r\n"); + let content = document.querySelector('div#articleBody'); + if (json_text && content) { + content.innerHTML = ''; + let article_new = document.createElement('p'); + article_new.innerText = json_text; + content.appendChild(article_new); + } + } + } + } +} + +else if (matchDomain('philonomist.com')) { + let paywall = document.querySelector('div.content-bandeau'); + if (paywall && window.location.pathname.startsWith('/en/')) { + removeDOMElement(paywall); + let json_script = getArticleJsonScript(); + if (json_script) { + let json = JSON.parse(json_script.text); + if (json) { + let json_text = parseHtmlEntities(findKeyJson(json, ['articleBody'])).replace(/\s{2,}/g, '\r\n\r\n'); + let article = document.querySelector('div.main-body'); + if (json_text && article) { + let par_last = article.querySelector('div > p:last-child'); + if (par_last) { + let par_last_str = par_last.innerText.substring(0, 50); + if (json_text.replace(/<[^<]*>/g, '').includes(par_last_str)) { + par_last.innerText = json_text.substring(json_text.indexOf(par_last_str)); + } else { + article.innerHTML = ' '; + let article_new = document.createElement('p'); + article_new.innerText = json_text; + article.appendChild(article_new); + } + } + } + } + } + } +} + +else if (matchDomain('project-syndicate.org')) { + func_post = function () { + let hidden_images = document.querySelectorAll('img[src][new-cursrc]'); + for (let elem of hidden_images) { + if (elem.src.startsWith('data:image/')) + elem.src = elem.getAttribute('new-cursrc'); + elem.style = 'width: 95%;'; + } + } + let url = window.location.href; + getArchive(url, 'div.paywall--base', '', 'main > article'); +} + +else if (matchDomain('puck.news')) { + let url = window.location.href; + getArchive(url, 'div[class*="paywall"]', '', 'article'); + let modal = document.querySelector('div#paywall-modal'); + removeDOMElement(modal); + let overlay = document.querySelector('body.paywall-active'); + if (overlay) + overlay.classList.remove('paywall-active'); +} + +else if (matchDomain('reuters.com')) { + let ads = 'div[data-testid="ResponsiveAdSlot"], div[data-testid="Dianomi"]'; + hideDOMStyle(ads); +} + +else if (matchDomain('rugbypass.com')) { + if (window.location.pathname.match(/^\/plus\/\w/)) { + let paywall = document.querySelector('.premium-fold-bottom'); + if (paywall) { + paywall.classList.remove('premium-fold-bottom'); + let offer = document.querySelector('.plus-article-offer'); + removeDOMElement(offer); + let fade = document.querySelector('.fade'); + if (fade) + fade.classList.remove('fade'); + } + let lazy_images = document.querySelectorAll('figure > img.lazy[data-src]:not([src])'); + for (let elem of lazy_images) { + elem.src = elem.getAttribute('data-src'); + elem.removeAttribute('class'); + } + } +} + +else if (matchDomain('scientificamerican.com')) { + setCookie('article_meter', '', 'scientificamerican.com', '/', 0); +} + +else if (matchDomain('scholastic.com')) { + let paywall = document.querySelector('div.paywallModalElement'); + if (paywall) { + let modal = document.querySelector('div.modal-backdrop'); + removeDOMElement(paywall, modal); + let body_modal = document.querySelector('body.modal-open'); + if (body_modal) + body_modal.removeAttribute('class'); + } +} + +else if (matchDomain('science.org')) { + let paywall = document.querySelector('div.alert-read-limit'); + removeDOMElement(paywall); + let overlay = document.querySelector('body.alert-read-limit__overlay'); + if (overlay) + overlay.classList.remove('alert-read-limit__overlay'); +} + +else if (matchDomain('scmp.com')) { + window.setTimeout(function () { + if (matchDomain('amp.scmp.com')) { + amp_unhide_subscr_section('div.ad-banner, div.advert-fly-carpet-container, div.inline-advert'); + let amp_images = document.querySelectorAll('section.article-body amp-img[src]'); + for (let elem of amp_images) { + let img = document.createElement('img'); + img.src = elem.getAttribute('src'); + img.alt = elem.getAttribute('alt'); + img.style = 'width: 90%;'; + elem.parentNode.replaceChild(img, elem); + } + let default_meters = document.querySelectorAll('div[id^="default-meter-page-views"]'); + removeDOMElement(...default_meters); + } else { + let paywall = document.querySelectorAll('div[data-qa="GenericArticle-PaywallContainer"], div.js-reading-0-percent-completion-tracker'); + if (paywall.length) { + removeDOMElement(...paywall); + let article = document.querySelector('section[data-qa="ContentBody-ContentBodyContainer"]'); + if (article) { + let json_script = document.querySelector('script#__NEXT_DATA__'); + if (json_script) { + try { + let json = JSON.parse(json_script.text); + if (json && json.props.pageProps.payload.data.article.body.json) { + let pars = json.props.pageProps.payload.data.article.body.json; + if (pars && pars.length) + article.innerHTML = ''; + for (let par of pars) { + let elem = document.createElement('p'); + if (window.location.pathname.startsWith('/magazines/')) + elem.style = 'margin: 20px 0px;'; + if (['p', 'h3'].includes(par.type)) { + for (let sub_elem of par.children) { + if (sub_elem.type === 'text') { + if (sub_elem.data) + elem.appendChild(document.createTextNode(sub_elem.data)); + } else if (['a', 'em', 'span', 'strong'].includes(sub_elem.type)) { + let first_child = sub_elem.children && sub_elem.children[0]; + if (sub_elem.children && sub_elem.children.length > 1) { + let elem_text = sub_elem.children.map(x => x.data || x.children[0].data).join(''); + first_child = {type: 'text', data: elem_text}; + } + if (first_child) { + if (first_child.type === 'text') { + if (first_child.data) { + let a_link = document.createElement('span'); + if (sub_elem.attribs && sub_elem.attribs.href) { + a_link = document.createElement('a'); + a_link.style = 'text-decoration: underline;'; + a_link.href = sub_elem.attribs.href; + if (!matchUrlDomain(window.location.hostname, sub_elem.attribs.href)) + a_link.target = '_blank'; + } else if (sub_elem.type === 'em') + a_link.style = 'font-style: italic;'; + else if (sub_elem.type === 'strong') + a_link.style = 'font-weight: bold;'; + a_link.innerText = first_child.data; + elem.appendChild(a_link); + } + } + } + } else if (sub_elem.type === 'img') { + if (sub_elem.attribs) { + let attribs = sub_elem.attribs; + if (attribs.src) + elem = makeFigure(attribs.src, attribs.title, {alt: attribs.alt, style: 'width: 100%;'}, {style: 'font-size: 80%;'}); + } + } else { + console.log(sub_elem); + } + } + } else if (par.type === 'div') { + if (par.attribs) { + if (par.attribs.class === 'image-inline-container') { + if (par.children && par.children[0]) { + let attribs = par.children[0].attribs; + if (attribs.src) + elem = makeFigure(attribs.src, attribs.title, {alt: attribs.alt, style: 'width: 100%;'}, {style: 'font-size: 80%;'}); + } + } else if (par.attribs.class.match(/(methode-html|oembed|video)-wrapper/) && par.children) { + addIframe(par.children); + function addIframe(par_children) { + for (let sub_elem of par_children) { + if (sub_elem.children) + addIframe(sub_elem.children); + if (sub_elem.type === 'iframe') { + let attribs = sub_elem.attribs; + if (attribs.src) { + let figure = document.createElement('figure'); + let iframe = document.createElement('iframe'); + iframe.src = attribs.src; + if (attribs.width && attribs.height) { + if (!attribs.width.includes('%')) { + let ratio = attribs.width / (article.offsetWidth); + iframe.width = attribs.width / ratio; + iframe.height = attribs.height / ratio; + } else { + iframe.width = attribs.width; + iframe.height = attribs.height; + } + } else if (attribs.style) { + iframe.style = attribs.style; + if (attribs.height) + iframe.height = attribs.height; + } + figure.appendChild(iframe); + if (attribs.title) { + let iframe_title = document.createElement('figcaption'); + iframe_title.innerText = attribs.title; + iframe_title.style = 'font-size: 80%;'; + figure.appendChild(iframe_title); + } + elem.appendChild(figure); + } + } + } + } + } else if (par.attribs.class) + console.log(par); + } + } else if (!['blockquote-quote', 'inline-ad-slot', 'track-viewed-percentage'].includes(par.type)) + console.log(par); + if (elem.hasChildNodes()) + article.appendChild(elem); + } + } + } catch (err) { + console.log(err); + } + } + } + } + } + }, 0); + let ads = 'div[data-qa*="AdSlot"], div.adblock-message'; + hideDOMStyle(ads); +} + +else if (matchDomain('seattletimes.com')) { + let ads = 'div.top-ad-wrapper, div.ad, div.native-ad-article'; + hideDOMStyle(ads); +} + +else if (matchDomain('sfstandard.com')) { + setCookie('zephr-session', '', 'sfstandard.com', '/', 0); + let paywall = document.querySelector('div#paywall-container'); + if (paywall) { + removeDOMElement(paywall); + refreshCurrentTab(); + } + let ads = 'div.sticky'; + hideDOMStyle(ads); +} + +else if (matchDomain(sg_sph_media_domains)) { + if (matchDomain('straitstimes.com')) { + func_post = function () { + header_nofix('main', 'div#sph_cdp_4:not(:empty)', 'BPC > no archive-fix'); + } + let url = window.location.href; + getArchive(url, 'div[id][data-sdkids-campaigntype="pay_wall"]', '', 'main'); + } else if (matchDomain('businesstimes.com.sg')) { + let article = document.querySelector('div.body-content > div[class]'); + if (article) { + let par_hidden = article.querySelectorAll('p.hidden'); + if (par_hidden.length) { + par_hidden[0].parentNode.removeAttribute('class'); + for (let elem of par_hidden) + elem.classList.remove('hidden'); + let fade = article.querySelector('p[class*="bg-gradient-to-t"]'); + if (fade) + fade.className = par_hidden[0].className; + } + } + } + let ads = 'div.ads, div[id^="dfp-ad-"], div.cx_paywall_placeholder, div[data-testid="cas-block-component"]'; + hideDOMStyle(ads); +} + +else if (matchDomain('slate.com')) { + let slate_roadblock = '.slate-roadblock'; + let ads = 'section[class*="-ad"]'; + hideDOMStyle(slate_roadblock + ', ' + ads); +} + +else if (matchDomain('slideshare.net')) { + window.localStorage.clear(); + let limit_overlay = document.querySelector('.limit-overlay'); + if (limit_overlay) + limit_overlay.classList.remove('limit-overlay'); +} + +else if (matchDomain('sltrib.com')) { + let ads = 'div.ad, div.stickyAd, div.stickyTopAd, div[class^="sltrib_medrec"]'; + hideDOMStyle(ads); +} + +else if (matchDomain('sloanreview.mit.edu')) { + if (window.location.pathname.startsWith('/article/')) { + window.setTimeout(function () { + let pars = document.querySelectorAll('div.article-content > p'); + if (pars.length && pars.length < 7) + refreshCurrentTab(); + }, 1000); + } +} + +else if (matchDomain('sofrep.com')) { + setCookie('sofrep_news_ids', '', 'sofrep.com', '/', 0); + let paywall = document.querySelector('div.paywall'); + if (paywall) { + paywall.removeAttribute('class'); + let intro = document.querySelector('div.non-paywall'); + removeDOMElement(intro); + waitDOMElement('div#paywall_wrap', 'DIV', node => removeDOMElement(node.parentNode)); + } + let banners = document.querySelectorAll('#scrollerCTA, #botCta'); + removeDOMElement(...banners); +} + +else if (matchDomain('spglobal.com')) { + setCookie('count', '', 'spglobal.com', '/', 0); +} + +else if (matchDomain('standardmedia.co.ke')) { + let paywall = document.querySelector('div.paywall-container'); + if (paywall) { + removeDOMElement(paywall); + let json_script = getArticleJsonScript(); + if (json_script) { + try { + let json = JSON.parse(json_script.text.replace(/[\r\n]/g, '')); + if (json) { + let json_text = parseHtmlEntities(breakText(json.articleBody)).replace(/[\r\n]/g, '
').replace(/[^<]+

/, ''); + let article = document.querySelector('div.content'); + if (json_text && article) { + let parser = new DOMParser(); + let doc = parser.parseFromString('

' + json_text + '

', 'text/html'); + let article_new = doc.querySelector('p'); + let pars_old = article.querySelectorAll('p:not([class]), div.card-text'); + removeDOMElement(...pars_old); + article.appendChild(article_new); + } + } + } catch (err) { + console.log(err); + } + } + } + let ads = 'div.ad'; + hideDOMStyle(ads); +} + +else if (matchDomain('staradvertiser.com')) { + let paywall = document.querySelectorAll('div.fade'); + if (paywall.length) { + removeDOMElement(...paywall); + let div_hidden = document.querySelector('div#hsa-paywall-content[style]'); + if (div_hidden) + div_hidden.removeAttribute('style'); + let noscroll = document.querySelector('body.overflow-hidden'); + if (noscroll) + noscroll.classList.remove('overflow-hidden'); + } + let ads = 'div.promo-container, div.teads-inread'; + hideDOMStyle(ads); +} + +else if (matchDomain('startribune.com')) { + let ads = 'div[data-testid$="-ad"]'; + hideDOMStyle(ads); +} + +else if (matchDomain('statnews.com')) { + let paywall = document.querySelector('div.restricted-content-breaker'); + if (paywall) { + removeDOMElement(paywall); + let article = document.querySelector('div.entry-content, section.the-content'); + if (article) { + let url = window.location.href; + article.before(googleSearchToolLink(url)); + } + } + let ads = 'div.header-ad-wrap, div[class*="dfp-ad"]'; + hideDOMStyle(ads); +} + +else if (matchDomain('stereogum.com')) { + let ads = 'div.adthrive-ad'; + hideDOMStyle(ads); +} + +else if (matchDomain('stocknews.com')) { + let hideme = document.querySelector('div#hideme'); + removeDOMElement(hideme); + let blurmes = document.querySelectorAll('div[id^="blurme"]'); + for (let i = 0; i < blurmes.length; i++) + blurmes[i].setAttribute('id', 'blurmenot' + i); +} + +else if (matchDomain('stratfor.com')) { + let url = window.location.href; + getArchive(url, 'div#paywallCTAContainer:not(:empty)', '', 'main', '', 'main', 'h1'); +} + +else if (matchDomain('study.com')) { + let faded_content = document.querySelector('div.faded-content'); + if (faded_content) + faded_content.removeAttribute('class'); + let div_hidden = document.querySelector('div.hidden[ng-non-bindable]'); + if (div_hidden) + div_hidden.removeAttribute('class'); + let banners = document.querySelectorAll('div.article-cutoff-div'); + removeDOMElement(...banners); +} + +else if (matchDomain('swarajyamag.com')) { + if (!window.location.pathname.startsWith('/amp/')) { + let paywall = pageContains('h2', /Please Sign In To Continue Reading/); + let amphtml = document.querySelector('head > link[rel="amphtml"]'); + if (paywall.length) { + removeDOMElement(...paywall); + if (amphtml) + amp_redirect_not_loop(amphtml); + } + } +} + +else if (matchDomain('techinasia.com')) { + let paywall = document.querySelector('div.paywall-content'); + if (paywall) { + hideDOMStyle('div.paywall-content'); + let content_new = paywall.querySelector('div.content'); + let empty_par = content_new.querySelector('a.flourish-credit:not(img), h2:not(:has(~ p))'); + if (!empty_par) { + let div = document.createElement('div'); + div.className = paywall.className.replace('paywall-content', ''); + div.append(content_new); + paywall.before(div); + let container = document.querySelector('div.col div > div.container'); + if (container) + container.classList.remove('container'); + } else { + let url = window.location.href; + let url_xhr = url.replace('.com/', '.com/wp-json/techinasia/2.0/posts/').replace('/visual-story/', '/'); + fetch(url_xhr) + .then(response => { + if (response.ok) { + response.json().then(json => { + let json_text = json.posts[0].content; + json_text = json_text.replace(/width\=\"(\d){3,}\"/g, 'width="100%"').replace(/height\=\"(\d){3,}\"/g, 'height="100%"'); + if (json_text) { + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + json_text + '
', 'text/html'); + let content_new = doc.querySelector('div.content'); + let content = document.querySelector('div.content'); + if (content) + content_new.className = content.className; + paywall.before(content_new); + } + }); + } + }); + } + } + let splash_subscribe = document.querySelector('div.splash-subscribe'); + let paywall_hard = document.querySelector('div.paywall-hard'); + removeDOMElement(splash_subscribe, paywall_hard); +} + +else if (matchDomain(['techtarget.com', 'computerweekly.com'])) { + let paywall = document.querySelector('div.paywall'); + if (paywall) { + paywall.classList.remove('paywall'); + let banners = document.querySelectorAll('p#firstP, div#inlineRegistrationWrapper'); + removeDOMElement(...banners); + } +} + +else if (matchDomain('the-american-interest.com')) { + let counter = document.getElementById('article-counter'); + removeDOMElement(counter); +} + +else if (matchDomain('the-scientist.com')) { + let paywall = document.querySelector('div.paywall'); + if (paywall) { + paywall.classList.remove('paywall'); + let fader = document.querySelector('div.gated-fader'); + let modal = document.querySelector('div#Modal'); + removeDOMElement(fader, modal); + } +} + +else if (matchDomain('the-star.co.ke')) { + if (window.location.pathname.match(/(\d+-){3}/)) { + let paywall = document.querySelector('div.bg-gradient-to-b'); + if (paywall) { + removeDOMElement(paywall); + let article = document.querySelector('div.story-content'); + if (article) { + article.removeAttribute('class'); + let scripts = document.querySelectorAll('script[type]'); + let json_script + let script_start = 'self.__next_f.push([1,"'; + for (let script of scripts) { + if (script.text.startsWith(script_start) && script.text.includes('\\"initialCanonicalUrl\\":\\"')) { + let json_url = script.text.split('\\"initialCanonicalUrl\\":\\"')[1].split('\\"')[0]; + if (json_url && window.location.pathname !== json_url) + refreshCurrentTab(); + break; + } + } + for (let script of scripts) { + if (script.text.startsWith(script_start) && script.text.length > 1000 && !script.text.match(/({|\],?[\[\\]|data:image)/)) { + json_script = script; + break; + } + } + if (json_script) { + let intro_pars = article.querySelectorAll('p'); + removeDOMElement(...intro_pars); + let json_text = json_script.text.split('self.__next_f.push([1,"')[1].split('"])')[0].replace(/^.+\\n\\n\\n/, '').replace(/\.\\n((\\r\\n)+)?/g, '.\r\n\r\n').replace(/(\\r)?\\n/g, ' ').replace(/\\"/g, '"').replace(/\\u0026/g, '&'); + let article_new = document.createElement('div'); + article_new.style = 'margin: 20px 0px;'; + article_new.innerText = parseHtmlEntities(json_text); + article.appendChild(article_new); + } + } + } + } +} + +else if (matchDomain('theamericanconservative.com')) { + let paywall_sel = 'section.c-blog-post__body--locked'; + let paywall = document.querySelector(paywall_sel); + if (paywall) { + let art_options = { + art_append: 1, + func_text: function (json_text) { + if (json_text.includes('

')) { + let split = json_text.split(/(

)/); + json_text = split[1] + split[2]; + }; + return json_text; + } + }; + getJsonUrl(paywall_sel, {rm_class: 'c-blog-post__body--locked'}, 'div.c-blog-post__content', art_options); + } else { + let img_dark = document.querySelector('div.c-hero-article__image-img.o-image'); + if (img_dark) + img_dark.removeAttribute('class'); + } + let modal = document.querySelector('div#emailsub-modal'); + removeDOMElement(modal); + let noscroll = document.querySelector('body.modal-open'); + if (noscroll) + noscroll.classList.remove('modal-open'); +} + +else if (matchDomain('theamericanscholar.org')) { + getJsonUrl('div.ssagk-form', '', 'div.post_summary'); +} + +else if (matchDomain('theatlantic.com')) { + let banners = 'aside#paywall, div[class^="LostInventoryMessage_"]'; + hideDOMStyle(banners); +} + +else if (matchDomain('thebaltimorebanner.com')) { + let ads = 'div.article-body__inline-ad'; + hideDOMStyle(ads); +} + +else if (matchDomain('thebulletin.org')) { + getJsonUrl('div.article--cropped', '', 'div#body-copy', {art_append: 1}); +} + +else if (matchDomain('thedailybeast.com')) { + let paywall = document.querySelector('div.Body__paywall-container'); + if (paywall) { + removeDOMElement(paywall); + let json_script = document.querySelector('script[displayName="initialState"]'); + if (json_script) { + let json_str = json_script.text.substring(json_script.textContent.indexOf('{')); + try { + let json = JSON.parse(json_str); + if (json.body) { + let pars = json.body.sections; + let cards = json.body.cards; + if (pars) { + let mobile_doc = document.querySelector('div.Mobiledoc'); + if (mobile_doc) { + let mobile_doc_text = mobile_doc.innerText.replace(/(\r|\n)/g, ''); + for (let elem of pars) { + let par_elem = ''; + if (elem[0] === 1) { + if (elem[1] === 'p') { + let par = ''; + for (let part of elem[2]) + par += part[3]; + if (par && !mobile_doc_text.includes(par)) { + par_elem = document.createElement('p'); + par_elem.innerText = par; + } + } + } else if (elem[0] === 10) { + if (cards && cards[elem[1]]) { + let card = cards[elem[1]]; + if (card[0] === 'pt-image') { + par_elem = document.createElement('p'); + let par_fig = makeFigure(card[1].url, card[1].title + ' ' + card[1].credit); + par_elem.appendChild(par_fig); + } else if (card[0] === 'pt-fancy-links-card') { + par_elem = document.createElement('p'); + let par_link = document.createElement('a'); + par_link.href = card[1].links; + par_link.innerText = card[1].linksData[0].long_headline; + par_elem.appendChild(par_link); + } + } + } + if (par_elem) + mobile_doc.appendChild(par_elem); + } + } + } + } + } catch (err) { + console.log(err); + } + } + } + let ads = document.querySelectorAll('div > div.tdb-ads-block'); + for (let ad of ads) + hideDOMElement(ad.parentNode); +} + +else if (matchDomain('thediplomat.com')) { + if (matchDomain('magazine.thediplomat.com')) { + let article = document.querySelector('article > section.h-96'); + if (article) { + article.classList.remove('h-96'); + let art_body = article.querySelector('div.prose'); + if (art_body) { + let art_img = article.parentNode.querySelector('figure > picture > img[src]'); + let art_img_src; + let art_img_match; + if (art_img) { + art_img_src = art_img.getAttribute('src'); + let match = art_img.getAttribute('src').match(/\/media\/\d+\/(\w+)\.\w+/); + if (match) + art_img_match = match[1]; + } + let url = window.location.href.split(/[#\?]/)[0]; + fetch(url) + .then(response => { + if (response.ok) { + response.text().then(html => { + if (html.includes('')[0].trim().replace(/blocs:\[\{.*?\}\],/g, ''); + if (url_id && !json.includes('{"' + url_id + '":')) + refreshCurrentTab(); + } + let article = document.querySelector('div.html-content'); + let no_intro = false; + if (!article) { + article = document.querySelector('div.container-mobile-full'); + no_intro = true; + } + if (article && json) { + let content = ''; + if (json.includes('text_1="')) + content = json.split('text_1="').pop().split('";')[0]; + else { + let parts = json.split('html:"'); + parts.splice(0, 1); + for (let part of parts) + content += part.split('",has_pre_content')[0]; + } + if (content) { + content = content.replace(/\\u003C/g, '<').replace(/\\u003E/g, '>').replace(/\\u002F/g, '/').replace(/\\"/g, '"').replace(/\\r\\n/g, ''); + let parser = new DOMParser(); + let content_new = parser.parseFromString('

' + content + '
', 'text/html'); + let iframely = content_new.querySelectorAll('div > div.fr-iframely'); + for (let elem of iframely) { + let url_dom = elem.querySelector('[data-iframely-url]'); + if (url_dom) { + let iframe = document.createElement('iframe'); + iframe.src = url_dom.getAttribute('data-iframely-url'); + iframe.style = 'width: 100%; height: 400px;'; + elem.parentNode.replaceChild(iframe, elem); + } + } + let article_top; + if (!no_intro) { + article_top = article.parentNode.parentNode; + removeDOMElement(article.parentNode); + } else + article_top = article; + article_top.appendChild(content_new.querySelector('div')); + } else { + refreshCurrentTab(); + } + } + } + }, 2000); + let ads = 'div[class*="ads_type_"]'; + hideDOMStyle(ads); +} + +else if (matchDomain('atlantico.fr')) { + let ads = 'div#pv_atf, div#infeed'; + hideDOMStyle(ads); +} + +else if (matchDomain('autohebdo.fr')) { + if (window.location.hostname.startsWith('www.') && window.location.pathname.endsWith('.html')) + getJsonUrl('div.box-info.yellow', '', 'div.editor', {art_append: 1}); +} + +else if (matchDomain(be_groupe_ipm_domains)) { + let paywall = document.querySelector('div.is-preview'); + if (paywall) { + paywall.classList.remove('is-preview'); + window.setTimeout(function () { + let div_hidden = document.querySelector('div.is-hidden'); + if (div_hidden) + div_hidden.classList.remove('is-hidden'); + }, 500); + } + let ads = 'div.ap-AdContainer'; + hideDOMStyle(ads); +} + +else if (matchDomain('businessam.be')) { + let paywall = document.querySelector('div.paywall'); + if (paywall) { + removeDOMElement(paywall); + let article = document.querySelector('div.text-gradient'); + if (article) { + let filter = /window\.fullcontent64\s?=\s?"/; + let content_script = getSourceJsonScript(filter); + if (content_script) { + try { + let content = decode_utf8(atob(content_script.text.split(filter)[1].split('";')[0])); + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + content + '
', 'text/html'); + let content_new = doc.querySelector('div'); + article.parentNode.replaceChild(content_new, article); + } catch (err) { + console.log(err); + } + } + } + } +} + +else if (matchDomain('capital.fr')) { + let paywall = document.querySelector('div#articleWall-wrapper'); + if (paywall) { + removeDOMElement(paywall); + let article = document.querySelector('div#articleWall > div#articleWall-paid'); + if (article) { + article.removeAttribute('class'); + article.removeAttribute('hidden'); + article.style['margin-top'] = '40px'; + article.parentNode.removeAttribute('class'); + } + } + let videos = document.querySelectorAll('div > div#prisma-player-leader[data-ads-core*="Dailymotion"]'); + for (let video of videos) { + try { + let json = JSON.parse(video.getAttribute('data-ads-core')); + if (json && json.playerVideoId) { + let iframe = document.createElement('iframe'); + iframe.src = 'https://www.dailymotion.com/embed/video/' + json.playerVideoId; + iframe.style = 'height: ' + video.offsetHeight + 'px; width: ' + video.offsetWidth + 'px;'; + video.parentNode.replaceChild(iframe, video); + } + } catch (err) { + console.log(err); + } + } + let ads = 'div.ad, div.ads-display, div.outbrain-ads'; + hideDOMStyle(ads); +} + +else if (matchDomain(['challenges.fr', 'sciencesetavenir.fr'])) { + if (window.location.pathname.endsWith('.amp')) { + amp_unhide_access_hide('="paywall.access OR cha.access"', '="NOT (paywall.access OR cha.access)"'); + } else { + let content = document.querySelectorAll('.user-paying-content'); + for (let elem of content) { + elem.classList.remove('user-paying-content'); + elem.removeAttribute('hidden'); + } + let paywall = document.querySelector('.temp-paywall'); + removeDOMElement(paywall); + let amorce = 'div.amorce.manual'; + let ads = 'div[class*="pub-container"], div[id^="moneytag-"], div.pub-banniere-haute'; + hideDOMStyle(amorce + ', ' + ads); + } +} + +else if (matchDomain('charliehebdo.fr')) { + let paywall = document.querySelector('div#paywall'); + if (paywall) { + removeDOMElement(paywall); + let article = document.querySelector('article[id^="post-"]'); + if (article) { + let article_id = article.id.split('post-')[1]; + if (article_id) { + let intro_pars = article.querySelectorAll('div#principal > p'); + if (intro_pars.length) { + let url = window.location.href; + let json_url = 'https://charliehebdo.fr/wp-json/wp/v2/posts/' + article_id + '?appkey=' + 'JeSuisCharlie2023'; + fetch(json_url) + .then(response => { + if (response.ok) { + response.json().then(json => { + let json_text = json.content.rendered; + if (json_text) { + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + json_text + '
', 'text/html'); + let article_new = doc.querySelector('div'); + intro_pars[0].before(article_new); + removeDOMElement(...intro_pars); + } + }); + } + }); + } + } + } + } +} + +else if (matchDomain('connaissancedesarts.com')) { + let ads = 'div[class*="banniere"]'; + hideDOMStyle(ads); +} + +else if (matchDomain('courrierinternational.com')) { + let paywall = document.querySelector('div#bloc_paywall'); + if (paywall) { + removeDOMElement(paywall); + let article_sel = 'div.article-text'; + let article = document.querySelector(article_sel); + if (article) { + let url = window.location.href; + let url_src = 'https://apps.courrierinternational.com/cri/v1/premium-android-phone/article?id=' + encodeURIComponent(window.location.pathname); + let json_key = 'templates.raw_content.content'; + getExtFetch(url_src, json_key, {}, main_cri); + function main_cri(url, data) { + try { + if (data) { + let parser = new DOMParser(); + let doc = parser.parseFromString(data, 'text/html'); + let article_new = doc.querySelector(article_sel); + if (article_new) { + article_new.querySelectorAll('a[href^="crifr://article?id="]').forEach(e => e.href = decodeURIComponent(e.href.split('crifr://article?id=')[1].split('&')[0]).split('?')[0]); + article.parentNode.replaceChild(article_new, article); + } + } + } catch (err) { + console.log(err); + } + } + } + } + let ads = 'div.dfp-slot, div.dfp__container'; + hideDOMStyle(ads); +} + +else if (matchDomain('elle.fr')) { + if (window.location.hostname.startsWith('amp.')) { + amp_unhide_access_hide('="poool.access OR cmi_premium.access"'); + } else { + let hidden_images = document.querySelectorAll('img[src^="data:image/"][data-src]'); + for (let hidden_image of hidden_images) + hidden_image.setAttribute('src', hidden_image.getAttribute('data-src')); + let subscription_bar = document.querySelector('.tc-subscription-bar'); + removeDOMElement(subscription_bar); + } + let ads = 'div[class*="--placeholder"]'; + hideDOMStyle(ads); +} + +else if (matchDomain(fr_be_groupe_rossel_domains)) { + let paywall = document.querySelector('r-panel.r-panel--paywall'); + if (paywall) { + removeDOMElement(paywall); + hideDOMStyle('r-mini-panel.r-mini-panel--froomle, div.r-paywall', 2); + let article = document.querySelector('article.r-article > r-article--section, div.r-content, div#article_paywall_es, div.qiota_reserve'); + if (article) { + article.removeAttribute('class'); + article.removeAttribute('id'); + let article_id; + let url_src; + let match = window.location.pathname.match(/^\/(art\/|id)?(\d+)\//); + if (match) { + article_id = match[2]; + let apps = 'apps'; + let apps_list = { + 'aisnenouvelle.fr': 'an', + 'courrier-picard.fr': 'cp', + 'lardennais.fr': 'ar', + 'lest-eclair.fr': 'ee', + 'liberation-champagne.fr': 'lc', + 'lunion.fr': 'un' + }; + for (let domain in apps_list) { + if (matchDomain(domain)) + apps += '_' + apps_list[domain]; + } + url_src = window.location.origin + '/api/article/' + apps + '/' + article_id + '.json'; + } else { + let match_archive = window.location.pathname.match(/\/art\/(d-\d+-\w+)$/); + if (match_archive) { + article_id = match_archive[1]; + url_src = window.location.origin + '/api/archive-detail/apps/' + article_id + '.json'; + } + } + if (url_src) { + fetch(url_src) + .then(response => { + if (response.ok) { + response.json().then(json => { + if (json.body) { + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + json.body + '
', 'text/html'); + let article_new = doc.querySelector('div'); + article_new.querySelectorAll('iframe[allow*="fullscreen"][allowfullscreen]').forEach(e => e.removeAttribute('allowfullscreen')); + article.innerHTML = ''; + article.appendChild(article_new); + } + }) + } else + header_nofix(article, '', 'BPC > no fix (source file)'); + }).catch(err => console.log(err)); + } else + header_nofix(article); + } + } + let ads = 'r-pub, div.adm-ad-loading'; + hideDOMStyle(ads); +} + +else if (matchDomain(fr_groupe_ebra_domains)) { + function ebra_main() { + window.setTimeout(function () { + let url_src = window.location.origin + "/services/grdc/detail?key=" + getWebContentKey(); + fetch(url_src) + .then(response => { + if (response.ok) { + response.json().then(json => { + if (json.html) { + let article = document.querySelector('article.viewPartial:not(.done)'); + if (article) { + article.classList.add('done'); + let intro = article.querySelectorAll('div.fullDetailActions, div.illustration, div.videoComponent'); + removeDOMElement(...intro) + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + json.html + '
', 'text/html'); + let article_new = doc.querySelector('div'); + let infos = article.querySelector('div.infos'); + if (infos) + infos.after(article_new); + let body_content = document.querySelector('div.retrievedBodyContent'); + if (body_content) { + let widget = article.querySelector('div.col_main div#poool-widget'); + if (widget) + body_content.before(widget); + } + article.classList.remove('locked'); + let preview = document.querySelector('div.previewContent'); + removeDOMElement(preview); + if (typeof $ !== 'undefined') { + $("head").append(json.js); + formatWsContent(); + } else { + let carousel = article.querySelector('ul.carousel-wrapper__slides'); + if (carousel) { + carousel.removeAttribute('class'); + carousel.querySelectorAll('li > figure').forEach(e => e.removeAttribute('class')); + removeDOMElement(carousel.querySelector('figure:has(img[src^="data:image"])')); + } + } + let accroche = document.querySelector('.mainContent .accroche'); + if (accroche) + accroche.classList.add('unlocked'); + article.querySelectorAll('iframe[src=""][data-src]').forEach(e => e.src = e.getAttribute('data-src')); + } + } + }) + } + }).catch(err => console.log(err)); + }, 1000); + } + let paywall = document.querySelector('div#paywall-dynamic'); + if (paywall) { + removeDOMElement(paywall); + insert_script(ebra_main); + } + let ads = 'div.wrapperPub'; + hideDOMStyle(ads); +} + +else if (matchDomain(fr_groupe_la_depeche_domains)) { + let paywall = document.querySelector('div.paywall'); + if (paywall) { + removeDOMElement(paywall); + let article = document.querySelector('div.article-full__body-content'); + if (article) { + article.removeAttribute('style'); + article.removeAttribute('data-state'); + } + } + let ads = 'div.ad'; + hideDOMStyle(ads); +} + +else if (matchDomain(fr_groupe_nice_matin_domains)) { + if (window.location.pathname.startsWith('/amp/')) { + amp_iframes_replace(); + let qiota_script = document.querySelector('amp-script.i-amphtml-layout-size-defined[src$="/qiota-amp.js"]'); + if (qiota_script) { + qiota_script.classList.remove('i-amphtml-layout-size-defined'); + let amp_images = document.querySelectorAll('amp-img > img.i-amphtml-fill-content'); + for (let elem of amp_images) + elem.removeAttribute('class'); + let sizers = document.querySelectorAll('i-amphtml-sizer'); + removeDOMElement(...sizers); + } + } + let ads = 'div[class^="ad-slot-"]'; + hideDOMStyle(ads); +} + +else if (matchDomain('humanite.fr')) { + let paywall = document.querySelector('div.message-paywall'); + if (paywall) { + let js_vars_script = document.querySelector('script[id="module-sage-index.js-js-extra"]'); + if (js_vars_script && js_vars_script.text.match(/js_vars\s?=\s?/)) { + removeDOMElement(paywall); + let js_vars = js_vars_script.text.split(/js_vars\s?=\s?/)[1].split('};')[0] + '}'; + try { + let json = JSON.parse(js_vars); + if (json && json.ajaxUrl && json.ajaxNonce && json.postId) { + fetch(json.ajaxUrl, { + method: "POST", + body: new URLSearchParams({ + action: 'unlock-post-content', + security: json.ajaxNonce, + post_id: json.postId + }) + }).then(response => { + if (response.ok) { + response.json().then(json => { + if (json.success) { + let article = document.querySelector('div#post-content'); + if (article) { + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + json.data + '
', 'text/html'); + let article_new = doc.querySelector('div'); + article.innerHTML = ''; + article.appendChild(article_new); + } + } + }) + } + }) + } + } catch (err) { + console.log(err); + } + } + } + let banners = 'div#form_don'; + hideDOMStyle(banners); +} + +else if (matchDomain('jeuneafrique.com')) { + let now_date = (new Date()).toISOString().split('T')[0]; + let ls_date = localStorage.getItem('###_json_date') || ''; + let ls_json_articles = {}; + let ls_json_urls = {}; + function show_data(article, body, ls_json_urls) { + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + body + '
', 'text/html'); + let article_new = doc.querySelector('div'); + let readmore_links = article_new.querySelectorAll('div.sc-lire-aussi'); + for (let elem of readmore_links) { + elem.style = 'margin-bottom: 20px'; + let app_link = elem.querySelector('a[href^="jeuneafrique://article/"'); + if (app_link) { + let match = app_link.href.match(/\d+$/); + if (match && ls_json_urls[match[0]]) + app_link.href = ls_json_urls[match[0]]; + } + } + article.innerHTML = ''; + article.parentNode.replaceChild(article_new, article); + } + function store_data(json, limit, limit_low = 100, article_id = '', article = '') { + try { + let src_articles = json.articles.filter(x => !x.content_status_open); + if (src_articles) { + if (article_id) { + let src_article = src_articles.filter(x => x.id == article_id)[0]; + if (src_article) + show_data(article, src_article.content_full, ls_json_urls); + else + header_nofix(article, '', 'BPC > no fix (source file)'); + } + if (!ls_date || limit > limit_low || now_date > ls_date) { + ls_json_articles = {}; + ls_json_urls = {}; + } else if (ls_date && !Object.keys(ls_json_articles).length) { + let ls_articles = localStorage.getItem('###_json'); + ls_json_articles = JSON.parse(ls_articles); + let ls_urls = localStorage.getItem('###_json_urls') || {}; + ls_json_urls = JSON.parse(ls_urls); + } + for (let art of src_articles) + ls_json_articles[art.id] = art.content_full; + for (let art of json.articles) + ls_json_urls[art.id] = art.url; + localStorage.setItem('###_json', JSON.stringify(ls_json_articles)); + localStorage.setItem('###_json_date', now_date); + localStorage.setItem('###_json_urls', JSON.stringify(ls_json_urls)); + } + } catch (err) { + console.log(err); + } + } + if (true) { + let paywall = document.querySelector('div#poool-widget'); + if (paywall) { + removeDOMElement(paywall); + let article = document.querySelector('div.article__content > div[data-mrf-recirculation]'); + let article_id = window.location.pathname.split('/')[1]; + if (article && article_id) { + let limit_low = 50 + randomInt(50); + let limit_high = 600 + randomInt(100); + function fetch_data(limit) { + let url_src = 'https://www.jeuneafrique.com/api/mobile/v6.0/featured/?limit=' + limit + '&rel=' + randomInt(100000); + fetch(url_src, {headers: {"x-exp": "1741079242710", "x-sig": "b431724e94023a6969c5427133e1614db2cbe90e"}}) + .then(response => { + if (response.ok) { + response.json().then(json => { + store_data(json, limit, limit_low, article_id, article); + }) + } else { + header_nofix(article, '', 'BPC > no fix (source file)'); + } + }).catch(x => header_nofix(article, '', 'BPC > no fix (source file)')) + } + let json_date; + let json_script = document.querySelector('script[type="application/ld+json"]'); + if (json_script) { + try { + let json = JSON.parse(json_script.text); + if (json && json['@graph']) { + let date_arr = json['@graph'].filter(x => x.datePublished); + if (date_arr.length) + json_date = date_arr[0].datePublished; + } + } catch (err) { + console.log(err); + } + } + let art_date = json_date ? json_date.split('T')[0] : now_date; + if (ls_date) { + let ls_articles = localStorage.getItem('###_json'); + ls_json_articles = JSON.parse(ls_articles); + let ls_urls = localStorage.getItem('###_json_urls') || {}; + ls_json_urls = JSON.parse(ls_urls); + let art_data = ls_json_articles[article_id]; + if (art_data) + show_data(article, art_data, ls_json_urls); + else if (ls_date < art_date) + fetch_data(limit_high); + else if (now_date === art_date) + fetch_data(limit_low); + else + header_nofix(article, '', 'BPC > no fix (source file)') + } else { + fetch_data(limit_high); + } + } + } + let ads = 'div.banner-ad, div.box-ad-brand'; + hideDOMStyle(ads); + } +} + +else if (matchDomain('journaldunet.com')) { + let reg_wall = document.querySelector('div.reg_wall'); + removeDOMElement(reg_wall); + let entry_reg_wall = document.querySelector('div.entry_reg_wall[style]'); + if (entry_reg_wall) + entry_reg_wall.removeAttribute('style'); +} + +else if (domain = matchDomain('lamanchelibre.fr') || matchDomain(fr_groupe_la_manche_libre_custom_domains)) { + let paywall = document.querySelector('div#paywall_ctn'); + if (paywall) { + removeDOMElement(paywall); + let article_id_match = window.location.pathname.match(/^\/\w+-(\d+)-/); + if (article_id_match) { + let article_id = article_id_match[1]; + let article = document.querySelector('div.article_txt'); + if (article_id && article) { + let url_src = 'https://app-api.' + domain + '/v1/getNew.php?id=' + article_id; + fetch(url_src) + .then(response => { + if (response.ok) { + response.json().then(json => { + try { + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + json.result[0].body + '
', 'text/html'); + let article_new = doc.querySelector('div'); + article_new.className = article.className; + article_new.classList.remove('melody'); + let ng_images = article_new.querySelectorAll('div.picture_container > p > img[ng-src]:not([src])'); + for (let elem of ng_images) { + elem.src = elem.getAttribute('ng-src'); + let fs_button = elem.parentNode.parentNode.querySelector('div.fullscreen_button'); + removeDOMElement(fs_button); + } + article.parentNode.replaceChild(article_new, article); + } catch (err) { + console.log(err); + } + }) + } + }) + } + } + } + let ads = 'div.class_pub, div#tbl-next-up'; + hideDOMStyle(ads); +} + +else if (matchDomain('lecho.be')) { + let url = window.location.href; + func_post = function () { + if (mobile) { + document.querySelectorAll('figure img[loading="lazy"][style]').forEach(e => e.style = 'width: 95%;'); + } + let pars = document.querySelectorAll('div[itemprop="articleBody"] > div'); + if (pars.length) { + if (pars.length < 5) + pars[0].before(googleSearchToolLink(url)); + } else { + let main = document.querySelector('main'); + if (main) + main.after(googleSearchToolLink(url)); + } + document.querySelectorAll('[inert]').forEach(e => e.removeAttribute('inert')); + } + if (matchDomain('investisseur.lecho.be')) { + if (window.location.pathname.endsWith('.html')) { + getArchive(url, 'html.paywalled', {rm_class: 'paywalled'}, 'main'); + addStyle('body {overflow: auto !important}'); + } + let banner = document.querySelector('div[data-id="react-paywall-auth0"]'); + removeDOMElement(banner); + } else { + window.setTimeout(function () { + let close_button = document.querySelector('button.ds-modal__top-bar__closebutton'); + if (close_button) + close_button.click(); + }, 1000); + let paywall_sel = 'html.paywall-active'; + let paywall = document.querySelector(paywall_sel); + if (paywall) { + if (!window.location.href.includes('/live-blog/')) + getArchive(url, paywall_sel, {rm_class: 'paywall-active'}, 'article'); + else { + paywall.classList.remove('paywall-active'); + let main = document.querySelector('main'); + if (main) + main.after(googleSearchToolLink(url)); + } + } + } +} + +else if (matchDomain('lecourrierdesstrateges.fr')) { + let paywall = document.querySelector('div.jpw-truncate-btn'); + if (paywall) { + removeDOMElement(paywall); + let json_script = getArticleJsonScript(); + if (json_script) { + let json = JSON.parse(json_script.text); + if (json) { + let json_text = json.articleBody; + let content = document.querySelector('div.content-inner'); + if (json_text && content) { + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + json_text + '
', 'text/html'); + let content_new = doc.querySelector('div'); + content.parentNode.replaceChild(content_new, content); + let hidden_images = document.querySelectorAll('img[src][srcset]'); + for (let elem of hidden_images) + elem.removeAttribute('srcset'); + let entry_content = document.querySelector('div.entry-content[style]'); + if (entry_content) + entry_content.removeAttribute('style'); + } + } + } + } +} + +else if (matchDomain('ledevoir.com')) { + setCookie('pw6', '', 'ledevoir.com', '/', 0); + let counter = document.querySelector('.paywall-breakpoint-wrapper'); + removeDOMElement(counter); +} + +else if (matchDomain('lefigaro.fr')) { + let paywall = document.querySelector('div#fig-premium-paywall'); + if (paywall) { + removeDOMElement(paywall); + let article = document.querySelector('div[data-component="fig-content-body"]'); + if (article) { + let resource_key = '34e68a3419a876e36729503e2107dfa556e1a105892e27010130a30018ccbe60'; + let url = window.location.href.split([/\?#/])[0]; + let url_src = 'https://api-graphql.lefigaro.fr/graphql?id=FigaroCoreMobile_resourceByUrl_persistent_' + resource_key + '&variables={%22url%22:%20%22' + url + '%22}'; + fetch(url_src) + .then(response => { + if (response.ok) { + response.json().then(json => { + try { + let pars = json.data.resource.body.structured; + if (pars.length) + article.innerHTML = ''; + let parser = new DOMParser(); + for (let par of pars) { + let elem; + let sub_elem; + let par_type = par.__typename; + if (['Heading', 'Paragraph', 'ParagraphWithPaywall'].includes(par_type)) { + if (par.paywall) + par = par.paywall; + if (par.text.replace(/ /g, '')) { + let doc = parser.parseFromString('

' + par.text + '

', 'text/html'); + elem = doc.querySelector('p'); + if (par_type === 'Heading') + elem.style = 'font-weight: bold; font-size: 1.85rem;'; + } + } else if (['Photo', 'VideoFigaro'].includes(par_type)) { + if (par.thumbnail) + par = par.thumbnail; + if (par.image) { + elem = document.createElement('p'); + elem.className = 'fig-paragraph'; + let img = makeFigure(par.image.url, par.caption.replace(/<[^<]*>/g, '') + ' ' + par.credit, '', {class: 'fig-media__legend'}); + elem.append(img, document.createElement('br')); + } + } else if (par_type === 'Frame') { + if (par.text) { + elem = document.createElement('p'); + elem.className = 'fig-paragraph'; + let title = document.createElement('p'); + title.innerText = par.title; + title.className = 'fig-paragraph'; + title.style = 'font-weight: bold;'; + let doc = parser.parseFromString('
' + par.text + '
', 'text/html'); + let text = doc.querySelector('div'); + elem.append(title, text); + } + } else if (par_type.endsWith('Link')) { + if (par.link) + par = par.link; + if (par.title && par.url) { + elem = document.createElement('p'); + if (par.prefix) { + let prefix = document.createElement('span'); + prefix.innerText = par.prefix + ' '; + elem.append(prefix); + } + let link_elem = document.createElement('a'); + link_elem.href = par.url; + link_elem.innerText = par.title.replace(/<[^<]*>/g, ''); + link_elem.target = '_blank'; + elem.append(link_elem); + } + } else if (par.sourceCode) { + let doc = parser.parseFromString('
' + par.sourceCode + '
', 'text/html'); + elem = doc.querySelector('div'); + let tweet_link = elem.querySelector('a[href^="https://twitter.com/"], a[href^="https://x.com/"]'); + if (tweet_link) { + tweet_link.innerText = tweet_link.href; + tweet_link.target = '_blank'; + } + } else if (par_type === 'Youtube') { + if (par.id) { + elem = document.createElement('iframe'); + elem.src = 'https://www.youtube.com/embed/' + par.id; + elem.style = 'width: 100%; height: 400px;'; + } + } else if (par_type === 'List') { + if (par.list) { + elem = document.createElement('ul'); + elem.style = 'list-style: inside;'; + for (let item of par.list) { + let li = document.createElement('li'); + li.style = 'margin: 10px 0px;'; + let doc = parser.parseFromString('' + item + '', 'text/html'); + let span = doc.querySelector('span'); + li.appendChild(span); + elem.appendChild(li); + } + } + } else if (par_type === 'HorizontalRule') { + elem = document.createElement('hr'); + } else if (par_type === 'Quote') { + elem = document.createElement('blockquote'); + elem.style = 'margin: 30px;'; + let qtext = document.createElement('p'); + qtext.innerText = parseHtmlEntities(par.text); + qtext.style = 'font-weight: bold; font-size: 28px; margin: 15px 0px;'; + let qcredit = document.createElement('p'); + qcredit.innerText = par.credit ? parseHtmlEntities(par.credit) : ''; + elem.append(qtext, qcredit); + } else if (!['Brightcove'].includes(par_type)) { + console.log(par); + } + if (elem) + article.appendChild(elem); + } + } catch (err) { + console.log(err); + } + }) + } + }).catch(x => header_nofix(article, '', 'BPC > no fix (source file)')) + } + } +} + +else if (matchDomain('legrandcontinent.eu')) { + let paywall = document.querySelector('body.paywall, body.pw, body.softwall'); + if (paywall) + paywall.classList.remove('paywall', 'pw', 'softwall'); + let banners = document.querySelectorAll('div#fix-pw, div.disposableBanner'); + removeDOMElement(...banners); +} + +else if (matchDomain(['lejdd.fr', 'parismatch.com', 'public.fr'])) { + let banners = '.forbidden'; + let ads = 'div[class^="lmn-"], div.premium-hidden, div.p-aside--placeholder, section.outbrain-container'; + hideDOMStyle(banners + ', ' + ads); + 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('lemagit.fr')) { + let paywall = document.querySelector('div.paywall'); + if (paywall) { + paywall.classList.remove('paywall'); + let banners = document.querySelectorAll('p#firstP, div#inlineRegistrationWrapper'); + removeDOMElement(...banners); + } +} + +else if (matchDomain('lemonde.fr')) { + let url = window.location.href.split(/[\?#]/)[0]; + let paywall = document.querySelector('section.lmd-paywall'); + if (paywall) { + removeDOMElement(paywall); + let article = document.querySelector('.article__content'); + if (article) { + let match = url.match(/article.*_(\d+)_/); + if (match) { + let id = match[1]; + let url_base = 'https://apps.lemonde.fr/aec/v1/' + (window.location.pathname.startsWith('/en/') ? 'en/' : '') + 'premium-android-phone/article/'; + let url_src = url_base + id; + let json_key = 'template_vars.content'; + getExtFetch(url_src, json_key, {}, main_lemonde); + function main_lemonde(url, data) { + try { + if (data) { + let parser = new DOMParser(); + let doc = parser.parseFromString(data, 'text/html'); + let article_new = doc.querySelector('.article_content'); + if (article_new) { + article_new.className = 'article__content'; + article_new.querySelectorAll('p').forEach(e => e.className = 'article__paragraph'); + article_new.querySelectorAll('h2').forEach(e => e.className = 'article__sub-title'); + article_new.querySelectorAll('h3.question').forEach(e => e.className = 'article__question'); + article_new.querySelectorAll('figure').forEach(e => e.style = 'margin: 0px 10px;'); + article_new.querySelectorAll('div.see-also-container, div.reference').forEach(e => e.style = 'margin: 20px 0px;'); + let image_divs = article_new.querySelectorAll('div.image'); + for (let elem of image_divs) { + elem.style = 'margin: 20px 0px;'; + let img = elem.querySelector('a > img[data-src]'); + if (img) { + if (img.src.startsWith('data:image/')) + img.src = img.getAttribute('data-src'); + img.parentNode.before(img); + } + } + let videos = article_new.querySelectorAll('div.video-container'); + for (let video of videos) { + let video_id_dom = video.querySelector('div[data-provider="dailymotion"][data-id]'); + if (video_id_dom) { + let iframe = document.createElement('iframe'); + iframe.src = 'https://www.dailymotion.com/embed/video/' + video_id_dom.getAttribute('data-id'); + iframe.style = 'height: 400px; width: 100%; margin: 20px 0px;'; + video.parentNode.replaceChild(iframe, video); + } + } + let cartes = article_new.querySelectorAll('div.cartes > div.carte > img[src_700][src_350]'); + for (let elem of cartes) { + elem.parentNode.parentNode.removeAttribute('class'); + elem.src = mobile ? elem.getAttribute('src_350') : elem.getAttribute('src_700'); + elem.style = 'width: 90%; margin: auto;'; + } + let inread = article_new.querySelectorAll('div.inread-container'); + removeDOMElement(...inread); + let links = article_new.querySelectorAll('div.link-container > a[href^="lmfr://"]'); + function link_lemonde(url, data, elem) { + if (data) + elem.href = data; + } + for (let elem of links) { + let url_link = elem.href; + let url_match = url_link.split(/[\?#]/)[0].match(/^lmfr:\/\/.*element\/article\/(\d+)/); + if (url_match) { + let id = url_match[1]; + let url_src = url_base + id; + let json_key = 'element.url'; + getExtFetch(url_src, json_key, {}, link_lemonde, [elem]); + } else if (url_link.match(/^lmfr:\/.*\/live\/\d+\?/) && url_link.includes('www.lemonde.fr')) { + url_link = decodeURIComponent('https://www.lemonde.fr' + url_link.replace(/%25/g, '%').split('www.lemonde.fr')[1].split('.html')[0] + '.html'); + link_lemonde(url, url_link, elem); + } + } + article_new.querySelectorAll('div.reference > a[href^="lmfr://"][href*="/open-url?"][href*="&url="]').forEach(e => e.href = decodeURIComponent(e.href.split('&url=')[1].split('&')[0]).split('?')[0]); + article.innerHTML = ''; + article.parentNode.replaceChild(article_new, article); + } + } + } catch (err) { + console.log(err); + } + } + } + } + } + let ads = 'div.dfp-slot, div.dfp__container, div.media-notice'; + hideDOMStyle(ads); +} + +else if (matchDomain('leparisien.fr')) { + func_post = function () { + let ads = 'section#left div[style^="background-color:"]'; + hideDOMStyle(ads, 2); + } + let url = window.location.href; + getArchive(url, 'div.paywall', '', 'section#left'); + let ads = 'div.ad_element'; + hideDOMStyle(ads); +} + +else if (matchDomain('lepoint.fr')) { + function lepoint_main() { + function decryptVariable(a) { + var t = ["point", "les", "payants", "top"], + n = ["le", "avec", "articles", "c"], + o = (function () { + var o = []; + for (var e = 0; e < 4; e++) + o.push(n[e]), o.push(t[e]); + return o + })(), + e = { + stringify: function (o) { + var e = { + ct: o.ciphertext.toString(CryptoJS.enc.Base64) + }; + return o.iv && (e.iv = o.iv.toString()), + o.salt && (e.s = o.salt.toString()), + JSON.stringify(e) + }, + parse: function (o) { + var e = JSON.parse(o), + t = CryptoJS.lib.CipherParams.create({ + ciphertext: CryptoJS.enc.Base64.parse(e.ct) + }); + return e.iv && (t.iv = CryptoJS.enc.Hex.parse(e.iv)), + e.s && (t.salt = CryptoJS.enc.Hex.parse(e.s)), + t + } + }; + return JSON.parse(CryptoJS.AES.decrypt(JSON.stringify(a), o.join(" "), { + format: e + }).toString(CryptoJS.enc.Utf8)) + } + let article = document.querySelector('div#contenu'); + if (article && window.variable_article_poool) { + article.innerHTML = decryptVariable(window.variable_article_poool); + let videos = document.querySelectorAll('figure.video-dailymotion > blockquote[data-videoid]'); + for (let elem of videos) { + let elem_new = document.createElement('iframe'); + elem_new.src = 'https://www.dailymotion.com/embed/video/' + elem.getAttribute('data-videoid'); + elem_new.style = 'height: 400px;'; + elem.parentNode.replaceChild(elem_new, elem); + } + } + } + if (!matchDomain(['journal.lepoint.fr'])) { + let paywall = document.querySelectorAll('aside.paywall'); + if (paywall.length) { + removeDOMElement(...paywall); + insert_script(lepoint_main); + } + let ads = 'div[id*="WRAP_"], div#StickyPaywall, div#paywall-sticky, #article-body div.slotpub, div.sticky-block'; + hideDOMStyle(ads); + } else { + let url = window.location.href; + getArchive(url, 'div.accnt-cmp', '', 'article'); + } +} + +else if (matchDomain('lequipe.fr')) { + let paywall = document.querySelector('article.Article--limited div.Article__gradient'); + if (paywall) { + removeDOMElement(paywall); + hideDOMStyle('div.Article__paywall', 2); + addStyle('div.Article__paragraph--limited {visibility: visible !important; height: auto !important; margin: 0 0 20px !important;}'); + let article_id = window.location.pathname.match(/\d+$/)[0]; + let article = document.querySelector('div.article__body'); + if (article_id && article) { + let url_src = 'https://dwh.lequipe.fr/api/v4/efr/news/' + article_id; + fetch(url_src) + .then(response => { + if (response.ok) { + response.json().then(json => { + try { + let pars = json.items.filter(x => x.layout === 'article_body')[0].objet.paragraphs; + pars.shift(); + article.innerHTML = ''; + article.className += ' Article__paragraph'; + article.appendChild(document.createElement('br')); + addStyle('div.article__body > div.Paragraph {font-family: "DINNextLTPro-Regular", sans-serif; font-size: 18px; font-weight: 400; line-height: 26px;}', 2); + let parser = new DOMParser(); + for (let par of pars) { + let elem; + if (par.content || par.note) { + if (!par.content) + par.content = ''; + if ((par.content.match(/(^$)/g) || []).length !== 1) { + let elem_type = 'div'; + if (par.title) { + par.content = '

' + par.title + '

' + par.content; + } else if (par.note) { + if (par.note.label && par.note.rating) { + let par_img = par.note.image || par.note.picture; + let img = (par_img && par_img.url) ? '' : ''; + par.content = '

' + par.note.label + ': ' + par.note.rating + '

' + img + par.content; + } + } + let doc = parser.parseFromString('
' + par.content + '
', 'text/html'); + elem = doc.querySelector(elem_type); + } + } else if (par.title) { + elem = document.createElement('h2'); + elem.innerText = par.title; + } else if (par.media) { + if (par.media.url && par.media.ratio) { + let ratio = par.media.ratio; + if (!parseInt(ratio)) + ratio = 1.5; + let url = par.media.url.replace(/\\u002F/g, '/').replace('{width}', '400').replace('{height}', parseInt(400 / ratio)).replace('{quality}', '75'); + let caption = par.media.legende && par.media.legende.length > 2 ? par.media.legende : ''; + elem = makeFigure(url, caption, {}, {'style': 'font-weight: bold;'}); + } else if (par.media.__type === 'video' && par.media.id) { + let url = par.media.image.url.replace('{width}', '400').replace('{height}', 400).replace('{quality}', '75'); + elem = makeFigure(url, par.media.legend); + let video_link = document.createElement('a'); + video_link.href = video_link.innerText = 'https://geo.dailymotion.com/player.html?video=' + par.media.id; + video_link.style = 'text-decoration: underline;'; + video_link.target = '_blank'; + elem.appendChild(video_link); + } + } else if (par.__type === 'article_paragraph_playing_field') { + if (par.data) { + let url = par.data; + fetch(url) + .then(response => { + if (response.ok) { + response.json().then(json => { + if (json.arbitre && json.titulaires) { + let ids = [json.arbitre].concat(json.titulaires); + if (json.banc) + for (let elem of json.banc) + ids = ids.concat([elem.entraineur], elem.remplacants); + let notes = document.querySelectorAll('span.EditorRatingsField__note'); + for (let note of notes) { + let name_dom = note.parentNode.querySelector('span[class$="--name"]'); + if (name_dom) { + let name = (name_dom.innerText.includes(':') ? name_dom.innerText.split(':')[1] : name_dom.innerText).trim(); + let json_note = ids.find(x => x.nom === name); + if (json_note) + note.innerText = json_note.note; + } + } + } + }) + } + }) + } + } else if (!['article_paragraph_pub'].includes(par.__type)) + console.log(par); + if (elem) + article.appendChild(elem); + } + } catch (err) { + console.log(err); + } + }) + } + }).catch(x => header_nofix(article, '', 'BPC > no fix (source file)')) + } + } + let ads = 'div.AmPlaceholder, div.Modal[data-modal="amsBlock"]'; + hideDOMStyle(ads); + let noscroll = document.querySelector('html'); + if (noscroll) + noscroll.style.overflow = 'auto'; +} + +else if (matchDomain('lerevenu.com')) { + let ads = 'div.wrapperAd'; + hideDOMStyle(ads); +} + +else if (matchDomain(['lesechos.fr', 'historia.fr'])) { + if (window.location.pathname.startsWith('/amp/')) { + ampToHtml(); + } else { + window.setTimeout(function () { + let paywall = document.querySelector('div#paywall, div#registerWall'); + if (paywall) { + removeDOMElement(paywall); + let filter = /window\.__REACT_QUERY_STATE__\s?=\s?/; + let json_script = getSourceJsonScript(filter); + if (json_script) { + try { + let json = JSON.parse(json_script.text.split(filter)[1].split('};')[0] + '}'); + let data_article = json.queries.filter(x => x.state.data.stripes)[0].state; + let url = window.location.href; + let url_loaded = data_article.data.path; + if (url_loaded && (!url_loaded.slice(-7).match(/\d+/) || !url.includes(url_loaded.slice(-7)))) + refreshCurrentTab(); + else { + let json_text = data_article.data.stripes[0].mainContent[0].data.description; + let article = document.querySelector('div.post-paywall'); + if (article) { + let contentNode = document.createElement('div'); + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + json_text + '
', 'text/html'); + let article_new = doc.querySelector('div'); + let videos = article_new.querySelectorAll('iframe[allow*="fullscreen"][allowfullscreen]'); + for (let elem of videos) { + elem.removeAttribute('allowfullscreen'); + if (mobile) + elem.style.width = '100%'; + } + if (article.parentNode && article_new) { + article.parentNode.replaceChild(article_new, article); + let article_lastnode = document.querySelector('.post-paywall > :last-child'); + if (article_lastnode) { + article_lastnode.setAttribute('style', 'height: auto !important; overflow: hidden !important; max-height: none !important;'); + } + } + } + let styleElem = document.head.appendChild(document.createElement('style')); + styleElem.innerText = ".post-paywall::after {height: auto !important;}"; + } + } catch (err) { + console.log(err); + } + } + } + let ads = 'div.sc-1u9r8h-0'; + hideDOMStyle(ads); + }, 500); + } +} + +else if (matchDomain('lesinrocks.com')) { + if (window.location.search.match(/(\?|&)amp/)) { + let size_defined = document.querySelector('amp-script.i-amphtml-layout-size-defined'); + if (size_defined) + size_defined.style = 'overflow:visible !important;'; + let overlays = document.querySelectorAll('section.learn_more, div.sidebar, div.menu-footer, div.tooltip_bib, footer.content-info'); + removeDOMElement(...overlays); + } +} + +else if (matchDomain('letelegramme.fr')) { + let paywall = document.querySelectorAll('div.tlg-paywalled'); + for (let elem of paywall) + elem.classList.remove('tlg-paywalled'); + let ads = 'div[id^="pub_"]'; + hideDOMStyle(ads); +} + +else if (matchDomain('letemps.ch')) { + let url = window.location.href; + getArchive(url, 'div.post-subscribe', '', 'div#article-body-wrapper'); + let fade = document.querySelector('div.post__content--faded'); + if (fade) + fade.classList.remove('post__content--faded'); + let top_ad = document.querySelector('div.topad'); + removeDOMElement(top_ad); +} + +else if (matchDomain(be_roularta_domains)) { + let paywall = document.querySelector('div[id*="wall-modal"]'); + if (paywall) { + removeDOMElement(paywall); + let html = document.querySelector('html[class]'); + if (html) + html.removeAttribute('class'); + function roularta_noscroll(node) { + node.removeAttribute('style'); + node.removeAttribute('class'); + } + waitDOMAttribute('html', 'html', 'class', roularta_noscroll, true); + let intro = document.querySelectorAll('div.article-body > p, div.article-body > style'); + removeDOMElement(...intro); + let locked = document.querySelector('body.locked'); + if (locked) + locked.classList.remove('locked'); + } + if (!window.navigator.userAgent.toLowerCase().includes('chrome') && window.location.href.match(/\/(\w+-){2,}/)) { + let lazy_images = document.querySelectorAll('img[src^="data:image/"][data-lazy-src]'); + for (let elem of lazy_images) { + elem.src = elem.getAttribute('data-lazy-src'); + } + } + let ads = 'div.rmgAd, div.c-header__ad'; + hideDOMStyle(ads); +} + +else if (matchDomain('lexpress.fr')) { + let ads = 'div[class^="block_pub"], div[class^="bottom-bar"], div.teads__block, div.ban-bottom, div[class^="placeholder--ban-atf"]'; + hideDOMStyle(ads); +} + +else if (matchDomain('liberation.fr')) { + let paywall = document.querySelector('div.article-body-paywall'); + if (paywall) { + removeDOMElement(paywall); + let article = document.querySelector('article[data-datawall-status]') || document.querySelector('div[class^="default__Main-sc-"] div:empty:not([class], [style])'); + if (article) { + let url_src = 'https://arc.api.liberation.fr/content/v4/?website=liberation&website_url=' + encodeURIComponent(window.location.pathname); + let x_api_key = 'a7X29mBvQeP1Ld98CgF2rK5uTzWY4h'; + fetch(url_src, {headers: {"x-api-key": x_api_key}}) + .then(response => { + if (response.ok) { + response.json().then(json => { + if (json && json.content_elements) { + let pars = json.content_elements; + if (pars.length) + article.innerHTML = ''; + let parser = new DOMParser(); + for (let par of pars) { + let elem = document.createElement('p'); + let sub_elem; + if (['header', 'raw_html', 'text'].includes(par.type)) { + if (par.content) { + let doc = parser.parseFromString('
' + par.content + '
', 'text/html'); + sub_elem = doc.querySelector('div'); + if (par.type === 'header') + sub_elem.style = 'font-weight: bold; font-size: 1.85rem;'; + } + } else if (par.type === 'correction') { + if (par.text) { + sub_elem = document.createElement('span'); + elem.innerText = par.text; + } + } else if (par.type === 'image') { + if (par.url) { + sub_elem = document.createElement('img'); + sub_elem.src = par.url; + } + } else if (par.type === 'custom_embed') { + if (par.embed && par.embed.config) { + let config = par.embed.config; + sub_elem = document.createElement('div'); + sub_elem.style = 'border: 1px solid black;'; + if (config.title) { + let sub_item = document.createElement('p'); + sub_item.innerText = config.title; + sub_item.style = 'font-weight: bold; margin: 20px;'; + sub_elem.appendChild(sub_item); + } + if (config.content) { + let sub_item = document.createElement('p'); + sub_item.innerText = config.content; + sub_item.style = 'margin: 20px;'; + sub_elem.appendChild(sub_item); + } + } else + console.log(par); + } else if (par.type === 'oembed_response') { + if (par.raw_oembed && par.raw_oembed.html) { + if (!par.subtype === 'twitter') { + let doc = parser.parseFromString('
' + par.raw_oembed.html + '
', 'text/html'); + sub_elem = doc.querySelector('div'); + } else if (par.raw_oembed.url) { + sub_elem = document.createElement('a'); + sub_elem.href = sub_elem.innerText = par.raw_oembed.url; + sub_elem.target = '_blank'; + } + } + } else if (par.type === 'link_list') { + if (par.items) { + sub_elem = document.createElement('p'); + sub_elem.appendChild(document.createElement('hr')); + sub_elem.appendChild(document.createTextNode('Lire aussi')); + sub_elem.appendChild(document.createElement('br')); + for (let item of par.items) { + if (item.content && item.url) { + let item_link = document.createElement('a'); + item_link.href = item.url; + item_link.innerText = item.content; + sub_elem.appendChild(item_link); + sub_elem.appendChild(document.createElement('br')); + } + } + sub_elem.appendChild(document.createElement('hr')); + } + } else if (!['quote'].includes(par.type)) { + console.log(par); + } + if (sub_elem) { + elem.appendChild(sub_elem); + article.appendChild(elem); + } + } + } + }) + } + }).catch(x => header_nofix(article, '', 'BPC > no fix (source file)')) + } + } + let ads = 'div[class^="StickyAd"], div[class^="default__OutbrainWrapper"]'; + hideDOMStyle(ads); +} + +else if (matchDomain('loeildelaphotographie.com')) { + let paywall = document.querySelector('.paywall'); + if (paywall) { + paywall.removeAttribute('class'); + } + let premium_pic_boxes = document.querySelectorAll('.premium-pic-box'); + let banners = document.querySelectorAll('.membership-promo-container, .login_form_litle'); + removeDOMElement(...premium_pic_boxes, ...banners); + let blurred_images = document.querySelectorAll('img[style*="blur"]'); + for (let blurred_image of blurred_images) + blurred_image.removeAttribute('style'); +} + +else if (matchDomain('lopinion.fr')) { + let url = window.location.href; + getArchive(url, 'div.paywall-premium', '', 'div.mainBody', '', 'div[style*=";line-height:1.8;"] div[style*=";line-height:1.8;"]'); + let ads = 'div.ResponsiveAd'; + hideDOMStyle(ads); +} + +else if (matchDomain('marianne.net')) { + let paywall = document.querySelector('div.paywall'); + if (paywall) { + removeDOMElement(paywall); + let article = document.querySelector('div > div.js-poool-wrapper'); + if (article) { + let limit_low = 50; + let limit_high = 400; + function show_data(article, body) { + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + body + '
', 'text/html'); + let article_new = doc.querySelector('div'); + let lazy_images = article_new.querySelectorAll('img.lazyload[data-src]:not([src])'); + for (let elem of lazy_images) { + elem.src = elem.getAttribute('data-src'); + elem.classList.remove('lazyload'); + } + article.innerHTML = ''; + article.parentNode.replaceChild(article_new, article); + } + function fetch_data(limit, offset = 0) { + let url_src = 'https://mobile.marianne.net/premium?limit=' + limit + '&offset=' + offset; + fetch(url_src) + .then(response => { + if (response.ok) { + response.json().then(json => { + try { + let src_articles = json.feed_auto; + if (src_articles) { + let src_article = src_articles.filter(x => x.urlWeb === url)[0]; + let ls_update = true; + if (src_article) + show_data(article, src_article.body); + else if (limit === limit_low) { + ls_update = false; + fetch_data(limit_high); + } else + header_nofix(article, '', 'BPC > no fix (source file)'); + if (ls_update) { + let now_date = (new Date()).toISOString().split('T')[0]; + if (!ls_date || limit > limit_low || now_date > ls_date) + ls_json_articles = {}; + for (let art of src_articles) + ls_json_articles[art.urlWeb] = art.body; + localStorage.setItem('###_json_date', now_date); + localStorage.setItem('###_json', JSON.stringify(ls_json_articles)); + } + } + } catch (err) { + console.log(err); + } + }) + } + }).catch(x => header_nofix(article, '', 'BPC > no fix (source file)')) + } + let url = window.location.href.split(/[#\?]/)[0]; + let meta_date = document.querySelector('head > meta[property="article:published_time"][content]'); + let art_date = ''; + if (meta_date) + art_date = meta_date.content.split('T')[0]; + let ls_date = localStorage.getItem('###_json_date') || ''; + let ls_json_articles = {}; + if (ls_date) { + let ls_articles = localStorage.getItem('###_json'); + ls_json_articles = JSON.parse(ls_articles); + if (ls_date <= art_date) + fetch_data(limit_low); + else { + let art_data = ls_json_articles[url]; + if (art_data) + show_data(article, art_data); + else if (Object.keys(ls_json_articles).length <= limit_low) + fetch_data(limit_high); + else + header_nofix(article, '', 'BPC > no fix (source file)') + } + } else { + fetch_data(limit_low); + } + } + } + let ads = 'div[class*="--placeholder"]'; + hideDOMStyle(ads); +} + +else if (matchDomain('ouest-france.fr')) { + if (matchDomain('www.ouest-france.fr')) { + function ouest_france_main() { + window.cmsfetch.push({ + url: window.cms_bypass_rpc_url, + params: { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + id: 'platform/bypass-payant/get', + jsonrpc: '2.0', + method: 'getToken', + params: { + publicitaire: !0, + id_contenu: window.dataLayer[0].mdId + } + }) + }, + fn: function (e) { + let data = JSON.parse(e); + let newURL = new URL(window.location.href); + newURL.searchParams.append('token', data.result.token); + window.location.href = newURL.toString(); + } + }); + } + if (!window.location.search.includes('token=')) { + let paywall = document.querySelector('div.mur'); + if (paywall) { + removeDOMElement(); + insert_script(ouest_france_main); + } + } else { + document.querySelectorAll('iframe:not([src])[data-embed-src]').forEach(e => e.src = e.getAttribute('data-embed-src')); + } + } else { + function ouest_france_sub() { + if (window.location.pathname.includes('/video-')) { + let video = document.querySelector('article figure'); + if (video) { + let og_video_dom = document.querySelector('head > meta[property="og:video"][content]'); + if (og_video_dom) { + let video_new = document.createElement('video'); + video_new.src = og_video_dom.content; + video_new.style = 'width: 100%;'; + video_new.setAttribute('controls', ''); + video.parentNode.replaceChild(video_new, video); + } + } + } else { + let title_dom = document.querySelector('head > meta[name="twitter:title"][content]'); + if (title_dom) { + let title = encodeURIComponent(title_dom.content); + let app_id = window.sessionStorage.getItem('###_app_id'); + fetch('https://' + app_id + '-dsn.algolia.net/1/indexes/*/queries', { + method: "POST", + headers: { + "Content-Type": "application/json", + "x-algolia-api-key": window.bp_algolia_articles, + "x-algolia-application-id": app_id.toUpperCase() + }, + body: JSON.stringify({ + requests: [{ + indexName: "articles", + params: 'query=' + title + } + ] + }) + }) + .then(response => { + if (response.ok) { + response.json().then(json => { + let results = json.results[0].hits; + let article = results.find((result) => result.articleId == window.dataLayer[0].mdId); + if (article) { + let body = document.querySelector('div#article-detail > div.su-article'); + if (body) { + body.parentNode.classList.remove('cache'); + let article_text = article.texte; + let pars = body.querySelectorAll('p, h2'); + for (let par of pars) { + let par_text = par.innerText.replace(/\u00a0/g, ' '); //  + if (article_text.startsWith(par_text)) { + article_text = article_text.replace(par_text, '').trim(); + } else if (par.tagName === 'P' && par_text.endsWith('...')) { + par.remove(); + break; + } + } + let par_new = document.createElement('p'); + par_new.innerText = article_text; + body.appendChild(par_new); + if (article.photos && article.photos.length > 1) { + let header_img = document.querySelector('article figure img[src]'); + if (header_img && header_img.src.includes('/pictures/')) { + let img_base = header_img.src.split('/pictures/')[0] + '/pictures/'; + let img_first = true; + for (let img of article.photos) { + if (!img_first) { + let figure = document.createElement('figure'); + figure.style = 'margin: 20px 0px;'; + let img_new = document.createElement('img'); + img_new.src = img_base + img.id; + let caption = document.createElement('figcaption'); + caption.innerText = img.legende + ' | ' + img.credits; + figure.append(img_new, caption); + body.appendChild(figure); + } else + img_first = false; + } + } + } + if (article.hasVideo) + console.log('hasVideo'); + } + } + }) + } + }).catch(err => console.log(err)); + } + } + } + let paywall = document.querySelector('div.mur'); + if (paywall) { + removeDOMElement(paywall); + window.sessionStorage.setItem('###_app_id', 'c8kp7jv01t'); + insert_script(ouest_france_sub); + } + } + let ads = 'div.pub, div.feed-taboola'; + hideDOMStyle(ads); + let banner = document.querySelector('div#pub_megabanner'); + removeDOMElement(banner); +} + +else if (matchDomain('philonomist.com')) { + let paywall = document.querySelector('div.content-bandeau'); + if (paywall) { + removeDOMElement(paywall); + let json_script = getArticleJsonScript(); + if (json_script) { + let json = JSON.parse(json_script.text); + if (json) { + let json_text = parseHtmlEntities(findKeyJson(json, ['articleBody'])).replace(/\s{2,}/g, '\r\n\r\n'); + let article = document.querySelector('div.main-body'); + if (json_text && article) { + let par_last = article.querySelector('div > p:last-child'); + if (par_last) { + let par_last_str = par_last.innerText.substring(0, 50); + if (json_text.replace(/<[^<]*>/g, '').includes(par_last_str)) { + par_last.innerText = json_text.substring(json_text.indexOf(par_last_str)); + } else { + article.innerHTML = ' '; + let article_new = document.createElement('p'); + article_new.innerText = json_text; + article.appendChild(article_new); + } + } + } + } + } + } +} + +else if (matchDomain('pourleco.com')) { + let paywall = document.querySelector('div[data-pleco-poool^="paywall"]'); + if (paywall) { + let intro = document.querySelector('div[data-pleco-transition="fade"]'); + removeDOMElement(paywall, intro); + let article = document.querySelector('div[class*="article-"][style]'); + if (article) + article.removeAttribute('style'); + } +} + +else if (matchDomain('reforme.net')) { + let article_sel = 'div.elementor-widget-theme-post-content'; + getJsonUrl(article_sel + ' section', '', article_sel); + let banner = 'div.free-access-banner'; + hideDOMStyle(banner); +} + +else if (matchDomain('science-et-vie.com')) { + if (window.location.hostname.startsWith('amp.')) { + let pars = document.querySelectorAll('.qiota_reserve > p, .qiota_reserve > h2'); + let pars_text = []; + for (let par of pars) { + if (pars_text.includes(par.innerText)) + removeDOMElement(par); + else + pars_text.push(par.innerText); + } + let sizer = document.querySelector('div.article-content > amp-script > i-amphtml-sizer'); + removeDOMElement(sizer); + let replaced_content = document.querySelector('div.i-amphtml-replaced-content'); + if (replaced_content) + replaced_content.removeAttribute('class'); + } +} + +else if (matchDomain(['sudouest.fr', 'charentelibre.fr', 'larepubliquedespyrenees.fr'])) { + let paywall = document.querySelectorAll('.visible-not-premium'); + if (paywall.length) { + removeDOMElement(...paywall); + let visible_premium = document.querySelectorAll('div.visible-premium'); + for (let elem of visible_premium) + elem.classList.remove('visible-premium'); + } + let footer_premium = '.footer-premium'; + let ads = 'div.pub, div.ph-easy-subscription'; + hideDOMStyle(footer_premium + ', ' + ads); +} + +else if (matchDomain('telerama.fr')) { + let paywall = document.querySelector('section.paywall'); + if (paywall) { + removeDOMElement(paywall); + let article_sel = 'article.article__page-content'; + let article = document.querySelector(article_sel); + if (article) { + let url_src = 'https://apps.telerama.fr/tlr/v1/premium-android-tablet/element?id=' + encodeURIComponent(window.location.pathname); + let json_key = 'templates.raw_content.content'; + getExtFetch(url_src, json_key, {}, main_telerama); + function main_telerama(url, data) { + try { + if (data) { + let parser = new DOMParser(); + let doc = parser.parseFromString(data, 'text/html'); + let article_new = doc.querySelector(article_sel); + if (article_new && article.parentNode) { + article_new.querySelectorAll('a[href^="tlrm://element?id="]').forEach(e => e.href = decodeURIComponent(e.href.split('tlrm://element?id=')[1])); + article_new.querySelectorAll('figure > img[data-src]:not([src])').forEach(e => e.src = e.getAttribute('data-src')); + article.parentNode.replaceChild(article_new, article); + } + } + } catch (err) { + console.log(err); + } + } + } + } + let ads = 'div.dfp-slot'; + hideDOMStyle(ads); +} + +else if (matchDomain('valeursactuelles.com')) { + let paywall = document.querySelector('div.qiota'); + if (paywall) { + removeDOMElement(paywall); + let qiota_hidden = document.querySelector('div.qiota_reserve'); + if (qiota_hidden) + qiota_hidden.removeAttribute('class'); + } + let banners = 'div.subscription-banner, div.stick-sidebar'; + hideDOMStyle(banners); +} + +else if (matchDomain('lamontagne.fr') || matchDomain(fr_gcf_custom_domains)) { // Groupe Centre France + let paywall = document.querySelector('meta[name="premium"][content="true"]'); + if (paywall) { + removeDOMElement(paywall); + let article = document.querySelector('div#content section > div.flex-col'); + if (article) { + let div_empty = article.querySelector('div[class^="min-h"]:empty'); + removeDOMElement(div_empty); + let url = window.location.href; + fetch(url) + .then(response => { + if (response.ok) { + response.text().then(html => { + if (html.includes('\\"contentJson\\":')) { + let html_json = html.split('\\"contentJson\\":')[1].split(']},\\"')[0].replace(/\\"/g, '"').replace(/\\\\"/g, '\\"') + ']}'; + try { + let json = JSON.parse(html_json); + if (json && json.content) { + let cf_paywall = json.content.find(x => x.type === 'cf-paywall'); + if (cf_paywall) { + let pars = cf_paywall.content; + for (let par of pars) { + function handle_par(par) { + let elem = document.createElement('div'); + if (['paragraph', 'heading', 'cf-line-heading', 'cf-quote'].includes(par.type)) { + if (par.content) { + if (par.type === 'heading') + elem.style = 'font-weight: bold;'; + else if (par.type === 'cf-quote') + elem.style = 'font-style: italic;'; + for (let item of par.content) { + let sub_elem; + if (item.text) { + sub_elem = document.createElement('span'); + let sub_elem_style = ''; + if (item.marks) { + for (let mark of item.marks) { + if (mark.type === 'link') { + if (mark.attrs && mark.attrs.href) { + sub_elem = document.createElement('a'); + sub_elem.href = mark.attrs.href; + sub_elem_style = 'text-decoration:underline;'; + } + } else if (mark.type === 'bold') + sub_elem_style += 'font-weight: bold;'; + else if (mark.type === 'italic') + sub_elem_style += 'font-style: italic;'; + if (sub_elem_style) + sub_elem.style = sub_elem_style; + } + } + sub_elem.innerText = item.text; + if (par.type === 'cf-quote') { + if (par.attrs && par.attrs.author) + sub_elem.innerText += ' - ' + par.attrs.author + (par.attrs.source ? ' ' + par.attrs.source : ''); + } + } else if (item.type === 'hardBreak') { + sub_elem = document.createElement('br'); + } else + console.log(item); + if (sub_elem) + elem.appendChild(sub_elem); + } + } + } else if (par.type === 'cf-image') { + if (par.attrs && par.attrs.src) { + elem = document.createElement('img'); + elem.src = par.attrs.src; + } + } else if (par.type === 'cf-embed') { + if (par.attrs && par.attrs.url) { + elem = document.createElement('iframe'); + elem.src = par.attrs.url.replace(/^\/\//, 'https://'); + if (par.attrs.width) + elem.width = par.attrs.width; + if (par.attrs.height) + elem.height = par.attrs.height; + } + } else if (par.type === 'cf-read-also') { + if (par.attrs && par.attrs.text && par.attrs.url) { + elem = document.createElement('a'); + elem.innerText = 'À lire aussi: ' + par.attrs.text; + elem.href = par.attrs.url; + elem.style = 'text-decoration:underline;'; + } + } else { + console.log(par); + } + if (elem) + article.appendChild(elem); + } + if (par.type === 'cf-aside' && par.content) { + for (let sub_par of par.content) + handle_par(sub_par); + } else + handle_par(par); + } + } + } + if (html.includes(',\\"textToSpeech\\":{')) { + let tts_url = html.split(',\\"textToSpeech\\":{')[1].split(',\\"url\\":\\"')[1].split('\\",\\"')[0]; + if (tts_url) { + let audio_div = document.createElement('div'); + audio_div.innerText = "Écouter l'article"; + audio_div.style = 'margin-bottom: 20px; font-weight: bold;'; + let audio = document.createElement('audio'); + audio.src = tts_url; + audio.style = 'width: 100%'; + audio.setAttribute('controls', ''); + audio_div.appendChild(audio); + article.before(audio_div); + } + } + } catch (err) { + console.log(err); + } + } + }) + } + }).catch(err => console.log(err)) + } + } + let ads = 'div.ad-slot, div[class="w-[100vw]"], div.transition-all'; + hideDOMStyle(ads); +} + +ads_hide(); +leaky_paywall_unhide(); + +}, 1000); + +// General Functions + +// import (see @require) + +})(); diff --git a/userscript/bpc.it.user.js b/userscript/bpc.it.user.js new file mode 100644 index 0000000..aa8888c --- /dev/null +++ b/userscript/bpc.it.user.js @@ -0,0 +1,395 @@ +// ==UserScript== +// @name Bypass Paywalls Clean - it +// @version 4.2.1.0 +// @description Bypass Paywalls of news sites +// @author magnolia1234 +// @downloadURL https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters/blob/raw?file=userscript/bpc.it.user.js +// @updateURL https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters/blob/raw?file=userscript/bpc.it.user.js +// @homepageURL https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters +// @supportURL https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters +// @license MIT; https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters/blob/raw?file=LICENSE +// @match *://*.it/* +// @match *://*.eastwest.eu/* +// @match *://*.ilsole24ore.com/* +// @match *://*.italian.tech/* +// @match *://*.quotidiano.net/* +// @match *://*.tuttosport.com/* +// @grant GM.xmlHttpRequest +// @require https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters/blob/raw?file=userscript/bpc_func.js +// ==/UserScript== + +(function() { + //'use strict'; + +window.setTimeout(function () { + +var it_gedi_domains = ['huffingtonpost.it', 'italian.tech', 'lastampa.it', 'lescienze.it', 'moda.it', 'repubblica.it']; +var it_ilmessaggero_domains = ['corriereadriatico.it', 'ilgazzettino.it', 'ilmattino.it', 'ilmessaggero.it', 'quotidianodipuglia.it']; +var it_quotidiano_domains = ['ilgiorno.it', 'ilrestodelcarlino.it', 'iltelegrafolivorno.it', 'lanazione.it', 'quotidiano.net']; + +if (matchDomain('corriere.it')) { + if (window.location.pathname.endsWith('_amp.shtml')) { + amp_unhide_subscr_section('iframe[src^="https://ads."]'); + } else { + if (window.location.pathname.includes('_preview.shtml') && !window.location.pathname.startsWith('/podcast/')) { + window.setTimeout(function () { + window.location.href = window.location.pathname.replace('_preview.shtml', '.shtml'); + }, 500); + } + } + let ads = 'div.bck-adv, div.boxADVmanuale'; + hideDOMStyle(ads); +} + +else if (matchDomain('corrieredellosport.it')) { + if (!window.location.pathname.startsWith('/amp/')) { + amp_redirect('div[class^="MainTextTruncated_paragraph__"]'); + let ads = 'div[class^="AdUnit_placeholder"]'; + hideDOMStyle(ads); + } +} + +else if (matchDomain('eastwest.eu')) { + let paywall = document.querySelector('.paywall'); + if (paywall) { + paywall.removeAttribute('style'); + paywall.classList.remove('paywall'); + let intro = document.querySelectorAll('div#testo_articolo > p, div#testo_articolo > h3'); + let offerta = document.querySelectorAll('div.offerta_abbonamenti'); + removeDOMElement(...intro, ...offerta); + } +} + +else if (matchDomain('editorialedomani.it')) { + let paywall = document.querySelector('div.paywallbox'); + if (paywall) { + removeDOMElement(paywall); + let article = document.querySelector('div.article-preview'); + if (article) { + article.classList.remove('article-faded'); + let json_script = getArticleJsonScript(); + if (json_script) { + let json = JSON.parse(json_script.text); + if (json) { + let json_text = json.articleBody; + let par = article.querySelector('p'); + if (par) + par.innerText = json_text; + } + } + } + } +} + +else if (matchDomain('gazzetta.it')) { + if (window.location.pathname.endsWith('_preview.shtml')) { + let paywall = document.querySelector('section.bck-freemium__wall'); + if (paywall) { + removeDOMElement(paywall); + if (!window.location.search.startsWith('?reason=unauthenticated')) { + window.location.href = window.location.pathname.replace('_preview', '') + '?gaa_at=g'; + } else { + let json_script = getArticleJsonScript(); + let header = 'div.content > h2'; + if (json_script) { + let json = JSON.parse(json_script.text); + if (json) { + let json_text = json.articleBody.replace(/(\s{3}| )/g, '\r\n\r\n'); + let content = document.querySelector('div.content > p.has-first-letter'); + if (json_text && content) { + let content_new = document.createElement('p'); + content_new.innerText = json_text; + content.parentNode.replaceChild(content_new, content); + let article_body = document.querySelector('section.body-article'); + if (article_body) + article_body.style = 'height: auto;'; + } else + header_nofix(header); + } + } else + header_nofix(header); + } + } + } else if (window.location.pathname.endsWith('_amp.shtml')) + ampToHtml(); +} + +else if (matchDomain('ilfattoquotidiano.it')) { + if (window.location.pathname.endsWith('/amp/')) { + amp_unhide_subscr_section('div#_4sVideoContainer, div#post-consent-ui'); + let logo = document.querySelector('a > amp-img[src$="/svg/logo-tablet.svg"]'); + if (logo) { + let logo_new = document.createElement('img'); + logo_new.src = logo.getAttribute('src').replace('/svg/logo-tablet.svg', '/fq-www/logo-ifq-it.svg'); + logo_new.height = logo.getAttribute('height'); + logo_new.width = logo.getAttribute('width'); + logo.parentNode.replaceChild(logo_new, logo); + } + } else { + let paywall = document.querySelector('div#ifq-paywall-metered'); + if (paywall) { + removeDOMElement(paywall); + let art_hidden = document.querySelector('article[id].cropped'); + if (art_hidden) + art_hidden.classList.remove('cropped'); + } else + header_nofix('div.ifq-post__content', 'div#ifq-paywall-hard'); + } + let ads = 'div.adv, div.st-adunit, div[id^="ifq-adv-"], div.mgbox'; + hideDOMStyle(ads); + let ad_units = document.querySelectorAll('div[id^="div-flx-"] > div[data-adunit]'); + for (let elem of ad_units) + hideDOMElement(elem.parentNode); +} + +else if (matchDomain('ilfoglio.it')) { + if (window.location.pathname.endsWith('/amp/')) { + amp_unhide_subscr_section('amp-ad, [class^="adv-"], div#gmpVideoContainer'); + } else { + amp_redirect('div.paywall'); + let ads = '.advertisement'; + hideDOMStyle(ads); + } +} + +else if (matchDomain('ilmanifesto.it')) { + let paywall = document.querySelector('div[class*="before:bg-gradient-to-t"]'); + if (paywall) { + removeDOMElement(paywall); + let article = document.querySelector('article div.prose'); + if (article) { + let filter = /^self\.__next_f\.push\(\[1,"/; + let scripts = document.querySelectorAll('script:not([src], [type])'); + for (let script of scripts) { + if (script.text.match(filter) && script.text.includes('canonical_url')) { + if (!script.text.includes(window.location.href)) + refreshCurrentTab(); + break; + } + } + let source_script = getSourceJsonScript(/^self\.__next_f\.push\(\[1,"\\u003c/); + if (source_script) { + let source_text = source_script.text.split(filter)[1].split('"])')[0].replace(/\\u003c/g, '<').replace(/\\u003e/g, '>').replace(/\\"/g, '"').replace(/\\n/g, ''); + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + source_text + '
', 'text/html'); + let article_new = doc.querySelector('div'); + let figures = article_new.querySelectorAll('figure[style]'); + for (let elem of figures) + elem.removeAttribute('style'); + article.innerHTML = ''; + article.appendChild(article_new); + } + } + } +} + +else if (matchDomain('ilsole24ore.com')) { + header_nofix('div.paywalltext', 'div.lock'); + waitDOMAttribute('body', 'BODY', 'style', node => node.removeAttribute('style'), true); + let ads = 'div.background-adv, div.abox, div.ob-smartfeed-wrapper, div.s24_adb'; + hideDOMStyle(ads); +} + +else if (domain = matchDomain(['iltirreno.it', 'lanuovasardegna.it']) || matchDomain(['gazzettadimodena.it', 'gazzettadireggio.it', 'lanuovaferrara.it'])) { + if (window.location.pathname.includes('/news/')) { + let paywall = document.querySelector('span > img[alt*="Paywall"]'); + if (paywall) { + let header = paywall.parentNode.parentNode; + header_nofix(header); + removeDOMElement(paywall.parentNode); + } + window.setTimeout(function () { + let banners = document.querySelectorAll('div.MuiSnackbar-root, div.css-16cchgy'); + removeDOMElement(...banners); + }, 1000); + } + setCookie(/__mtr$/, '', domain, '/', 0); +} + +else if (matchDomain(it_ilmessaggero_domains)) { + if (window.location.pathname.toLowerCase().includes('/amp/')) { + amp_unhide_subscr_section(); + } else { + let noscroll = document.querySelector('html[style]'); + if (noscroll) + noscroll.removeAttribute('style'); + let ads = 'div.adv_banner, div.inread_adv, div#outbrain'; + hideDOMStyle(ads); + } +} + +else if (matchDomain(it_quotidiano_domains)) { + if (window.location.pathname.endsWith('/amp') || window.location.search.startsWith('?amp')) { + amp_unhide_access_hide('="c.customGranted"', '="NOT c.customGranted"', 'amp-fx-flying-carpet, .watermark-adv, .amp__watermark'); + } else { + amp_redirect('div[data-testid="paywall-container"], div[class^="Paywall_paywall_"]', '', window.location.pathname + '/amp'); + let ads = 'div[id^="div-gpt-ad"]'; + hideDOMStyle(ads); + } +} + +else if (matchDomain('italiaoggi.it')) { + let paywall = document.querySelector('div.boxAbb'); + if (paywall) { + let overlay = document.querySelector('div.article-locked-overlay'); + removeDOMElement(paywall, overlay); + let article_locked = document.querySelector('div.article-locked'); + if (article_locked) { + article_locked.classList.remove('article-locked'); + let json_script = getArticleJsonScript(); + if (json_script) { + let json = JSON.parse(json_script.text); + if (json) { + let json_text = json.articleBody; + let content = article_locked.querySelector('section'); + if (json_text && content) { + let parser = new DOMParser(); + json_text = json_text.replace(/&apos;/g, "'").replace(/;/g, ''); + let doc = parser.parseFromString('
' + json_text + '
', 'text/html'); + let content_new = doc.querySelector('div'); + content.parentNode.replaceChild(content_new, content); + } + } + } + } + } +} + +else if (domain = matchDomain(it_gedi_domains)) { + let amp = window.location.pathname.match(/\/amp(\/)?$/); + if (matchDomain(['huffingtonpost.it', 'lastampa.it'])) { + if (window.location.pathname.includes('/news/')) { + if (!amp) { + let paywall = document.querySelector('iframe[id^="__limio_frame"]'); + if (paywall) { + setCookie(/blaize_session/, '', domain, '/', 0); + refreshCurrentTab(false); + } + let modal = document.querySelector('aside#widgetDP'); + removeDOMElement(modal); + } else + ampToHtml(); + } + } else if (matchDomain('repubblica.it')) { + if (!amp) + amp_redirect('iframe[id^="__limio_frame"]', '', window.location.pathname + 'amp/'); + else { + amp_unhide_subscr_section(); + if (!mobile) + addStyle('img.i-amphtml-fill-content {min-height: 50% !important; min-width: 50% !important;}'); + let paywall = document.querySelector('div.not_granted__content'); + if (paywall) { + removeDOMElement(paywall); + let article = document.querySelector('div.story__wrapper'); + if (article) { + let url = window.location.href.split(/[#\?]/)[0].replace(/\/amp\/$/, ''); + article.before(googleSearchToolLink(url)); + } + } + } + } else { + if (!amp) { + let paywall = document.querySelector('div#ph-paywall'); + removeDOMElement(paywall); + setCookie(/blaize_session/, '', domain, '/', 0); + } else + ampToHtml(); + } + let ads = 'div[id^="adv"]'; + hideDOMStyle(ads); +} + +else if (matchDomain('milanofinanza.it')) { + let paywall = document.querySelector('div.paywall-content, section.payment'); + if (paywall) { + removeDOMElement(paywall); + let json_script = getArticleJsonScript(); + if (json_script) { + try { + let json = JSON.parse(json_script.text.replace(/!=/g, '').replace(/!function\(\){[^!]+(\(\);|0;[a-z])/g, '')); + if (json) { + let json_text = parseHtmlEntities(json.articleBody); + let article = document.querySelector('div.article-locked'); + if (json_text && article) { + article.innerHTML = ''; + let article_new = document.createElement('p'); + article_new.innerText = json_text; + article.appendChild(article_new); + } + } + } catch (err) { + console.log(err); + header_nofix('div.article-locked', '', 'BPC > no fix (json-error)'); + } + } + } +} + +else if (matchDomain('sky.it')) { + let paywall = document.querySelector('div.c-paywall'); + if (paywall && window.location.hostname.match(/^(sport|tg24)\./)) { + removeDOMElement(paywall); + let article = document.querySelector('div > div.c-article-abstract'); + let json_script = getArticleJsonScript(); + if (article && json_script) { + try { + let json = JSON.parse(json_script.text); + if (json) { + let json_text = json[0].articleBody; + if (json_text) { + let par_new = document.createElement('p'); + par_new.innerText = json_text; + article.parentNode.appendChild(par_new); + } + } + } catch (err) { + console.log(err); + } + } + } + let ads = 'div.c-adv'; + hideDOMStyle(ads); +} + +else if (matchDomain('tuttosport.com')) { + if (!window.location.pathname.startsWith('/amp/')) { + let paywall = document.querySelector('div[class^="MainTextTruncated_premium"]'); + if (paywall) { + removeDOMElement(paywall); + let article = document.querySelector('div > div[class^="MainTextTruncated_truncatedContent"]'); + if (article) { + let json_script = document.querySelector('script#__NEXT_DATA__'); + if (json_script) { + try { + let json = JSON.parse(json_script.text); + if (json && json.props.pageProps.news && json.props.pageProps.news.content) { + let url_next = json.props.pageProps.news.href; + if (url_next && !window.location.pathname.includes(url_next)) + window.location.href = window.location.pathname; + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + json.props.pageProps.news.content + '
', 'text/html'); + let article_new = doc.querySelector('div'); + article.parentNode.replaceChild(article_new, article); + } else + refreshCurrentTab(); + } catch (err) { + console.log(err); + } + } + } + } + let ads = 'div[class^="AdUnit_"]'; + hideDOMStyle(ads); + } +} + +ads_hide(); +leaky_paywall_unhide(); + +}, 1000); + +// General Functions + +// import (see @require) + +})(); diff --git a/userscript/bpc.nl.user.js b/userscript/bpc.nl.user.js new file mode 100644 index 0000000..a7a24a0 --- /dev/null +++ b/userscript/bpc.nl.user.js @@ -0,0 +1,809 @@ +// ==UserScript== +// @name Bypass Paywalls Clean - nl/be +// @version 4.2.4.3 +// @description Bypass Paywalls of news sites +// @author magnolia1234 +// @downloadURL https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters/blob/raw?file=userscript/bpc.nl.user.js +// @updateURL https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters/blob/raw?file=userscript/bpc.nl.user.js +// @homepageURL https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters +// @supportURL https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters +// @license MIT; https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters/blob/raw?file=LICENSE +// @noframes +// @match *://*.nl/* +// @match *://*.businessam.be/* +// @match *://*.demorgen.be/* +// @match *://*.doorbraak.be/* +// @match *://*.flair.be/nl/* +// @match *://*.gva.be/* +// @match *://*.hbvl.be/* +// @match *://*.hln.be/* +// @match *://*.humo.be/* +// @match *://*.knack.be/* +// @match *://*.kw.be/* +// @match *://*.libelle.be/* +// @match *://*.nieuwsblad.be/* +// @match *://*.projectcargojournal.com/* +// @match *://*.railfreight.cn/* +// @match *://*.railfreight.com/* +// @match *://*.railtech.be/* +// @match *://*.railtech.com/* +// @match *://*.standaard.be/* +// @match *://*.taxipro.be/* +// @match *://*.tijd.be/* +// @connect archive.fo +// @connect archive.is +// @connect archive.li +// @connect archive.md +// @connect archive.ph +// @connect archive.vn +// @grant GM.xmlHttpRequest +// @require https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters/blob/raw?file=userscript/bpc_func.js +// ==/UserScript== + +(function() { + //'use strict'; + +window.setTimeout(function () { + +var be_mediahuis_domains = ['gva.be', 'hbvl.be', 'nieuwsblad.be', 'standaard.be']; +var be_roularta_domains = ['beleggersbelangen.nl', 'flair.be', 'knack.be', 'kw.be', 'libelle.be']; +var nl_dpg_adr_domains = ['ad.nl', 'bd.nl', 'bndestem.nl', 'destentor.nl', 'ed.nl', 'gelderlander.nl', 'pzc.nl', 'tubantia.nl']; +var nl_dpg_media_domains = ['demorgen.be', 'flair.nl', 'humo.be', 'libelle.nl', 'margriet.nl', 'parool.nl', 'trouw.nl', 'volkskrant.nl']; +var nl_mediahuis_region_domains = ['gooieneemlander.nl', 'haarlemsdagblad.nl', 'ijmuidercourant.nl', 'leidschdagblad.nl', 'limburger.nl', 'noordhollandsdagblad.nl']; + +if (matchDomain('adformatie.nl')) { + document.querySelectorAll('iframe[uc-src]').forEach(e => e.src = e.getAttribute('uc-src')); + let ads = 'div.c-ad-slot'; + hideDOMStyle(ads); +} + +else if (matchDomain(be_mediahuis_domains)) { + window.setTimeout(function () { + let video = document.querySelector('div.video, div[data-testid="article-video"]'); + func_post = function () { + let article = document.querySelector(article_sel); + if (article) { + if (video) { + if (matchDomain(['gva.be', 'nieuwsblad.be'])) { + let placeholder = video.querySelector('div[class^="Placeholder_placeholder"]'); + if (placeholder) + placeholder.removeAttribute('class'); + } + let video_new = article.querySelector('div[id$="-streamone"], div[id^="video-player-"], div[id^="player_"]'); + if (video_new && video_new.parentNode) + video_new.parentNode.replaceChild(video, video_new); + else { + let header = article.querySelector('h1'); + let br = document.createElement('br'); + if (header) + header.after(br, video, br); + } + } + let errors = document.querySelectorAll('div[height][old-src]:not([src]):has(div#__next_error__)'); + for (let elem of errors) { + let iframe = document.createElement('iframe'); + iframe.src = elem.getAttribute('old-src'); + iframe.style = 'width: 100%; height: ' + elem.getAttribute('height') + 'px;'; + elem.parentNode.replaceChild(iframe, elem); + } + if (mobile) { + if (article_main) { + let div_next = document.querySelector('div[id="__next"]'); + if (div_next) + article.style.width = div_next.offsetWidth + 'px'; + } + let lazy_images = article.querySelectorAll('figure img[loading="lazy"][style]'); + for (let elem of lazy_images) + elem.style = 'width: 95%;'; + let figures = article.querySelectorAll('figure div'); + for (let elem of figures) { + elem.removeAttribute('style'); + let svg = elem.querySelector('svg'); + removeDOMElement(svg); + } + } + let pars = article.querySelectorAll('div[style*="font-size"]'); + if (pars.length < 5) + article.before(googleSearchToolLink(url)); + } + } + let url = window.location.href; + let paywall_sel = 'head > meta[name$="article_ispaidcontent"][content="true"]'; + let article_sel = 'main > article'; + let article_main = document.querySelector(article_sel); + if (!article_main) + article_sel = 'article[role="article"] div[id]'; + getArchive(url, paywall_sel, '', article_sel); + let popup = document.querySelector('div[data-testid="close-popup-button"]'); + if (popup) + popup.click(); + }, 1500); + let ads = 'div[id^="ad_inline-"]'; + hideDOMStyle(ads); +} + +else if (matchDomain('businessam.be')) { + let paywall = document.querySelector('div.paywall'); + if (paywall) { + removeDOMElement(paywall); + let article = document.querySelector('div.text-gradient'); + if (article) { + let scripts = document.querySelectorAll('script:not([src]):not([type])'); + let content_script; + for (let script of scripts) { + if (script.text.match(/window\.fullcontent64\s?=\s?"/)) { + content_script = script; + break; + } + } + if (content_script) { + try { + let content = decode_utf8(atob(content_script.text.split(/window\.fullcontent64\s?=\s?"/)[1].split('";')[0])); + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + content + '
', 'text/html'); + let content_new = doc.querySelector('div'); + article.parentNode.replaceChild(content_new, article); + } catch (err) { + console.log(err); + } + } + } + } +} + +else if (matchDomain('businessinsider.nl')) { + getJsonUrl('div.piano-article__paywall', '', 'div.piano-article__content'); +} + +else if (matchDomain('doorbraak.be')) { + window.setTimeout(function () { + let plus = document.querySelector('h1 > svg'); + let article = document.querySelector('div > div.prose'); + if (plus && article) { + let paywall_sel = 'div.paywall'; + let paywall = document.querySelector(paywall_sel); + let pars = article.querySelectorAll('p'); + if (paywall || pars.length < 2) { + removeDOMElement(paywall); + waitDOMElement(paywall_sel, 'DIV', removeDOMElement, false); + let json_script = document.querySelector('script#__NUXT_DATA__'); + if (json_script) { + try { + if (!json_script.text.substr(0, 500).includes(window.location.pathname)) + refreshCurrentTab(); + let json = JSON.parse(json_script.text); + json = json.filter(x => typeof x === 'string' && x.startsWith('

')); + let json_text = json[0]; + if (json_text) { + let parser = new DOMParser(); + let doc = parser.parseFromString('

' + json_text + '
', 'text/html'); + let content_new = doc.querySelector('div'); + article.appendChild(content_new); + } + } catch (err) { + console.log(err); + } + } + } + } + }, 1000); +} + +else if (matchDomain(be_roularta_domains)) { + if (matchDomain('beleggersbelangen.nl')) { + let paywall = document.querySelector('div.unlimited-access'); + if (paywall) { + removeDOMElement(paywall); + let no_account = document.querySelector('div.no-account'); + if (no_account) + no_account.classList.remove('no-account'); + let content_inner = document.querySelector('div.content-inner[style]'); + if (content_inner) + content_inner.removeAttribute('style'); + } + } else { + let paywall = document.querySelector('div[id*="wall-modal"]'); + if (paywall) { + removeDOMElement(paywall); + let html = document.querySelector('html[class]'); + if (html) + html.removeAttribute('class'); + function roularta_noscroll(node) { + node.removeAttribute('style'); + node.removeAttribute('class'); + } + waitDOMAttribute('html', 'html', 'class', roularta_noscroll, true); + let intro = document.querySelectorAll('div.article-body > p, div.article-body > style'); + removeDOMElement(...intro); + let locked = document.querySelector('body.locked'); + if (locked) + locked.classList.remove('locked'); + } + if (!window.navigator.userAgent.toLowerCase().includes('chrome') && !matchDomain(['kw.be']) && window.location.href.match(/\/(\w+-){2,}/)) { + let lazy_images = document.querySelectorAll('img[src^="data:image/"][data-lazy-src]'); + for (let elem of lazy_images) { + elem.src = elem.getAttribute('data-lazy-src'); + } + } + } + let ads = 'div.rmgAd, div.c-header__ad'; + hideDOMStyle(ads); +} + +else if (matchDomain('ftm.nl')) { + let videos = document.querySelectorAll('div.body > div.video-pp'); + for (let video of videos) { + let video_id_dom = video.querySelector('a.video[data-youtube-id]'); + if (video_id_dom) { + video_new = document.createElement('iframe'); + video_new.src = 'https://www.youtube.com/embed/' + video_id_dom.getAttribute('data-youtube-id'); + video_new.style = 'width: 95%; height: 400px; margin: 0px 20px;'; + video.parentNode.replaceChild(video_new, video); + } + } + let audio_controls = document.querySelectorAll('audio[controls][style]'); + for (let elem of audio_controls) + elem.removeAttribute('style'); + document.querySelectorAll('div.foldable').forEach(e => e.classList.remove('foldable')); + let banners = 'div.banner-pp'; + hideDOMStyle(banners); +} + +else if (matchDomain('groene.nl')) { + let url = window.location.href; + getArchive(url, 'div#closed-block', '', 'article'); + let more = pageContains('div.wrapper > h2', 'Verder lezen?'); + if (more.length) { + let link_text = 'https://www.groene.nl/populair'; + let a_link = document.createElement('a'); + a_link.href = link_text; + a_link.innerText = 'BPC > ' + link_text.split('www.')[1]; + more[0].parentNode.append(document.createElement('br'), a_link); + } +} + +else if (matchDomain(['lc.nl', 'dvhn.nl']) || document.querySelector('head > link[href*=".ndcmediagroep.nl/"]')) { + let paywall = document.querySelector('div.signupPlus, div.pw-wrapper:not(.pw-none)'); + if (paywall && !window.location.pathname.includes('/live-')) { + let intro = document.querySelector('div.startPayWall'); + let html = document.documentElement.outerHTML; + if (html.includes('window.__NUXT__=')) { + removeDOMElement(paywall, intro); + try { + let json = html.split('window.__NUXT__=')[1].split('')[0].trim(); + let json_match = json.includes('type:"article",'); + if (json_match) { + let path_match = window.location.pathname.match(/-(\d+)\./); + if (path_match) { + let article_id = path_match[1]; + json_match = json.includes(',id:"' + article_id + '",'); + if (!json_match && json.match(/[(,]null,/)) { + let art_match = json.split(/[(,]null,/)[1].match(new RegExp('-' + article_id + '\\.', 'g')); + json_match = art_match && art_match.length > 1; + } + } + } + if (!json_match) + refreshCurrentTab(); + else if (json.includes(',body:')) { + let nuxt_vars = json.split(/^\(function\(/)[1].split('){')[0].split(','); + let nuxt_values = json.split('}}(')[1].split('));')[0].replace(/,(true|false|\d+|{}),/g, ',"$1",').replace(/,(null),/g, ',"$1",').replace(/,(void\s\d),/g, ',"$1",').split(/\\?",\\?"/); + function findNuxtText(str, attributes = false) { + if (nuxt_vars.length && nuxt_values.length && !(attributes && str.length === 1 && str === str.toUpperCase())) { + let index = nuxt_vars.indexOf(str); + if (nuxt_values[index]) + str = nuxt_values[index]; + } + return str; + } + let intro; + let intro_match = json.match(/,leadtext_raw:"([^"]+)",/); + let intro_meta_dom = document.querySelector('head > meta[data-hid="description"][content]'); + if (intro_match || intro_meta_dom) { + intro = document.createElement('p'); + intro.innerText = intro_match ? intro_match[1].replace(/\\u002F/g, '/') : intro_meta_dom.content; + intro.style = 'font-weight: bold;'; + } + let json_text = json.split(',body:')[1].split(/,(leadText|brand_key|tts|pianoKeywords):/)[0].replace(/([{,])(\w+)(?=:(["\{\[]|[\w$]{1,2}[,\}]))/g, "$1\"$2\"").replace(/(Image\\":)(\d)([,}])/g, '$1\\"$2\\"$3').replace(/\":(\[)?([\w\$\.]+)([\]},])/g, "\":$1\"$2\"$3"); + let article = document.querySelector('div.content'); + if (article) { + article.innerHTML = ''; + if (intro) + article.appendChild(intro); + let pars = JSON.parse(json_text); + function addParText(elem, par_text, add_br = false, attributes = false) { + if (par_text) { + if (par_text.length <= 2) + par_text = findNuxtText(par_text, attributes); + let span = document.createElement('span'); + span.innerText = par_text; + elem.appendChild(span); + if (add_br) + elem.appendChild(document.createElement('br')); + } + } + function addLink(elem, link_text, href, add_br = false) { + let par_link = document.createElement('a'); + par_link.href = href; + par_link.innerText = link_text; + elem.appendChild(par_link); + if (add_br) + elem.appendChild(document.createElement('br')); + } + function addImage(elem, child) { + let figure = document.createElement('figure'); + let img = document.createElement('img'); + img.src = child.relation.href; + figure.appendChild(img); + if (child.relation.caption) { + if (child.relation.caption.length <= 2) + child.relation.caption = findNuxtText(child.relation.caption).replace(/\\"/g, '"').replace(/\\n/g, ' - ').replace(/\\u002F/g, '/'); + if (child.relation.photographer) { + if (child.relation.photographer.length <= 2) + child.relation.photographer = findNuxtText(child.relation.photographer).replace(/\\u002F/g, '/'); + child.relation.caption += ' - ' + child.relation.photographer; + } + let caption = document.createElement('figcaption'); + caption.innerText = child.relation.caption; + figure.appendChild(caption); + } + elem.appendChild(figure); + } + function addChildren(elem, children, add_br = false, attributes = false) { + for (let child of children) { + if (child.text) { + addParText(elem, child.text, add_br, attributes); + } else if (child.relation && (child.type === 'img' || child.relation.caption) && child.relation.href) { + let img_par = document.createElement('p'); + addImage(img_par, child); + elem.appendChild(img_par); + } else if (child.relation && child.relation.link) { + if (child.relation.link.length <= 2) + child.relation.link = findNuxtText(child.relation.link).replace(/\\u002F/g, '/'); + if (child.relation.title.length <= 2) + child.relation.title = findNuxtText(child.relation.title); + addLink(elem, child.relation.title, child.relation.link); + } else if (child.children) { + if (child.children.length) { + for (let item of child.children) { + if (item.text) { + if ((child.href && child.href.length > 2) || (child.relation && child.relation.follow && child.relation.follow.url)) { + if (item.text.length > 2) + addLink(elem, item.text, child.href || child.relation.follow.url, add_br); + } else + addParText(elem, item.text, false, child.attributes && child.attributes.length); + } else + addChildren(elem, item.children, false, item.attributes && item.attributes.length); + } + } else + elem.appendChild(document.createElement('br')); + } + } + } + for (let par of pars) { + let elem = document.createElement('p'); + if (par.code) { + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + par.code + '
', 'text/html'); + elem = doc.querySelector('div'); + } else if (par.insertbox_head || par.insertbox_text) { + if (par.insertbox_head && par.insertbox_head.length > 2) + addParText(elem, par.insertbox_head, true); + if (par.insertbox_text) { + for (let item of par.insertbox_text) { + if (item.children) + addChildren(elem, item.children, true); + } + } + } else if (par.text) { + if (findNuxtText(par.type) !== 'streamer') + addParText(elem, par.text); + } else if (par.children) { + addChildren(elem, par.children); + } else if (par.typename.length > 2) + console.log(par); + if (elem.hasChildNodes()) { + article.appendChild(elem); + } + } + } + } + } catch (err) { + console.log(err); + } + } + } + let ads = 'div.top__ad, div.marketingblock-article'; + hideDOMStyle(ads); +} + +else if (matchDomain('linda.nl')) { + window.setTimeout(function () { + let paywall = document.querySelector('div.premium-login-box_loginBox'); + if (paywall) { + removeDOMElement(paywall); + let article = document.querySelector('div[class*="_loginRequired"]'); + if (article) { + let filter = /^window\.__INITIAL_PROPS__\s?=\s?/; + let json_script = getSourceJsonScript(filter); + if (json_script) { + try { + let json = JSON.parse(json_script.text.split(filter)[1]); + if (json) { + let slug = json.slug; + if ((slug && !window.location.pathname.includes(slug)) || !json.viewData) + refreshCurrentTab(); + if (json && json.viewData.article) { + function replace_also_read(str) { + return str.replace(/{also-read title="([^}]+)" url="([^}]+)" [^}]+"}/g, ""); + } + article.className = article.className.replace(/[-\w]+_loginRequired/, ''); + if (json.viewData.article.modules) { + let modules = json.viewData.article.modules; + article.innerHTML = ''; + for (let elem of modules) { + let type = elem.acf_fc_layout; + if (type) { + let item = document.createElement('div'); + if (['body_text', 'intro', 'quote'].includes(type)) { + if (elem.text) { + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + replace_also_read((elem.title ? elem.title : '') + elem.text.replace(/\r\n/g, '
')) + '
', 'text/html'); + item = doc.querySelector('div'); + if (type === 'intro') { + let intro = item.querySelector('p'); + if (intro) + intro.style = 'font-weight: bold; '; + } else if (type === 'quote') + item.style['text-align'] = 'center'; + article.append(item); + } + } else if (type === 'image') { + let elem_images = elem.images_portrait || elem.images_landscape; + if (elem_images && elem_images.length) { + for (let img of elem_images) { + let url = img.image.sizes.large; + let caption_text = img.credits ? img.credits.replace(/(\n|<[^<]*>)/g, '') : ''; + item = makeFigure(url, caption_text, {style: 'width: 100%;'}); + article.append(item); + } + } + } else + console.log(elem); + } + } + } else if (json.viewData.article.body) { + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + replace_also_read(json.viewData.article.body) + '
', 'text/html'); + let article_new = doc.querySelector('div'); + if (article_new) { + article.innerHTML = ''; + article.appendChild(article_new); + } + } else + header_nofix('div.article-content_base'); + } + } + } catch (err) { + console.log(err); + } + } + } + } + }, 1000); +} + +else if (matchDomain(nl_dpg_adr_domains.concat(['hln.be']))) { + func_post = function () { + let article = document.querySelector(article_sel); + if (article) { + let shades = article.querySelectorAll('div[style*="background-color"][style*=";width"]'); + for (let elem of shades) + elem.style.width = '85%'; + let lazy_images = article.querySelectorAll('picture img[loading="lazy"][style]'); + for (let elem of lazy_images) + elem.style = 'width: 95%;'; + let widgets = article.querySelectorAll('div > div > div[old-src]:not([src])'); + for (let elem of widgets) { + let iframe = document.createElement('iframe'); + iframe.src = elem.getAttribute('old-src'); + iframe.style = 'width: 100%; border: none;'; + if (iframe.src.includes('/widgets/') || iframe.src.includes('/playlists/')) + iframe.style.height = '400px'; + elem.parentNode.replaceChild(iframe, elem); + } + let errors = article.querySelectorAll('div > div[old-src]:not([src]):has(div#main-frame-error)'); + for (let elem of errors) { + let elem_new = document.createElement('iframe'); + elem_new.src = elem.getAttribute('old-src'); + elem_new.style = 'width: 100%; height: 400px; border: none;'; + elem.parentNode.removeAttribute('style'); + elem.parentNode.replaceChild(elem_new, elem); + } + let picture_divs = article.querySelectorAll('picture > div[style*="min-height:"]:has(svg)'); + for (let elem of picture_divs) { + elem.parentNode.removeAttribute('style'); + removeDOMElement(elem); + } + let video_scripts = article.querySelectorAll('div > div > script[type="application/ld+json"], article > script[type="application/ld+json"]'); + for (let elem of video_scripts) { + if (elem.text.includes(',"embedUrl":"')) { + let iframe = document.createElement('iframe'); + iframe.src = elem.text.split(',"embedUrl":"')[1].split('"')[0]; + iframe.style = 'width: 100%; height: 400px;'; + let container = elem.parentNode; + if (elem.parentNode.tagName === 'DIV') + container = container.parentNode; + container.parentNode.replaceChild(iframe, container); + } + } + } + let article_divs = document.querySelectorAll(article_src_sel + ' > div'); + if (article_divs.length < 3) + header_nofix(article_sel + ' > header', '', 'BPC > no archive-fix'); + } + let url = window.location.href; + let article_sel = 'div#remaining-paid-content'; + let article_src_sel = 'div#fjs-paywall-intro + div'; + let article = document.querySelector(article_sel); + if (article) { + article_src_sel += ', ' + article_sel; + getArchive(url, article_sel + '[data-reduced="true"]', {rm_attrib: 'data-reduced'}, article_sel, '', article_src_sel); + } else { + article_sel = 'article#article-content'; + article_src_sel += ', ' + article_sel + ' > section'; + let paywall_sel = article_sel + ' div[data-testid="premium"]'; + let paywall_action = {rm_attrib: 'data-testid'}; + if (!document.querySelector(paywall_sel)) { // regwal + paywall_sel = article_sel + ' > section[class]:empty'; + paywall_action = {rm_attrib: 'class'}; + } + getArchive(url, paywall_sel, paywall_action, article_sel + ' > section', '', article_src_sel, article_sel + ' > header'); + let ads = 'span[style*="background-color:"]:has(> span[style*="min-height:"])'; + hideDOMStyle(ads, 2); + } + let ads = 'div.dfp-space'; + hideDOMStyle(ads); +} + +else if (matchDomain(nl_dpg_media_domains)) { + setCookie('TID_ID', '', '', '/', 0); + let banners = 'aside[data-temptation-position^="ARTICLE_"], div[data-temptation-position^="PAGE_"], div[class^="ad--"], div[id^="article_paragraph_"]'; + hideDOMStyle(banners); + window.setTimeout(function () { + let elem_hidden = document.querySelectorAll('[class^="artstyle__"][style="display: none;"]'); + for (let elem of elem_hidden) + elem.removeAttribute('style'); + }, 500); +} + +else if (matchDomain(nl_mediahuis_region_domains)) { + let video = document.querySelector('div.video, div[data-testid="article-video"]'); + func_post = function () { + let article = document.querySelector(article_sel); + if (article) { + if (video) { + let video_new = article.querySelector('div[id$="-streamone"], div[id^="video-player-"], div[id^="player_"]'); + if (video_new && video_new.parentNode) + video_new.parentNode.replaceChild(video, video_new); + else { + let header = article.querySelector('h1'); + let br = document.createElement('br'); + if (header) + header.after(br, video, br); + } + } + if (mobile) { + let div_next = document.querySelector('div[id="__next"]'); + if (div_next) + article.style.width = div_next.offsetWidth - 20 + 'px'; + let lazy_images = article.querySelectorAll('figure img[loading="lazy"][style]'); + for (let elem of lazy_images) + elem.style = 'width: 95%;'; + let figures = article.querySelectorAll('figure div'); + for (let elem of figures) { + elem.removeAttribute('style'); + let svg = elem.querySelector('svg'); + removeDOMElement(svg); + } + } + if (article.innerText.length < 1000) { + let header = article.querySelector('hgroup'); + if (header) + header.before(googleSearchToolLink(url)); + } + } + } + let paywall_sel = 'head > meta[name$="article_ispaidcontent"][content="true"]'; + let article_sel = 'main > article'; + let url = window.location.href; + getArchive(url, paywall_sel, '', article_sel); + window.setTimeout(function () { + let noscroll = document.querySelector('body[class*="style_disable-scroll-popup"]'); + if (noscroll) + noscroll.style = 'position: static !important; overflow: visible !important'; + }, 500); + let banners = 'div[class*="style_popover"]';; + hideDOMStyle(banners); +} + +else if (matchDomain('nrc.nl')) { + setCookie('counter', '', '', '/', 0, true); + let banners = 'div[id$="modal__overlay"], div.header__subscribe-bar, div.banner, dialog.dmt-login-modal'; + hideDOMStyle(banners); +} + +else if (matchDomain('telegraaf.nl')) { + func_post = function () { + if (mobile) { + let article = document.querySelector('article'); + let body = document.querySelector('body'); + if (article && body) { + article.style.width = body.offsetWidth * 0.95; + let lazy_images = document.querySelectorAll('button > img[loading="lazy"]'); + for (let elem of lazy_images) { + elem.style = 'width: 100%;'; + elem.parentNode.style['min-height'] = 'auto'; + } + } + } + let gallery, img_width, captions, next, next_images, next_img_width; + let gallery_new = document.createElement('div'); + let figure_nr = 0; + let gallery_figures = document.querySelectorAll('div > ul > li > figure'); + for (let figure of gallery_figures) { + if (!figure_nr) { + gallery = figure.parentNode.parentNode.parentNode; + captions = Array.from(gallery.querySelectorAll('span')).filter(e => e.innerText.includes('©')); + next = gallery.nextSibling; + if (next) + next_images = next.querySelectorAll('img[currentsourceurl]'); + } + let img = figure.querySelector('img[currentsourceurl]'); + if (img && next_images) { + let img_src = img.getAttribute('currentsourceurl'); + if (img_src) { + if (img_src.includes('/alternates/')) + img_width = img_src.split('/alternates/')[1].split('/')[0]; + } else if (img_width && next_images[figure_nr]) { + img_src = next_images[figure_nr].getAttribute('currentsourceurl'); + if (img_src && img_src.includes('/alternates/')) { + next_img_width = img_src.split('/alternates/')[1].split('/')[0]; + img_src = img_src.replace(next_img_width, img_width); + } + } + let figure_new = makeFigure(img_src, captions && captions[figure_nr] ? captions[figure_nr].parentNode.innerText: '', {style: 'width: 100%;'}); + figure_new.style = 'margin: 20px 0px;'; + gallery_new.appendChild(figure_new); + } + figure_nr++; + } + if (gallery && next) { + next.after(gallery_new); + removeDOMElement(gallery, next); + } + let iframes = pageContains('div[style]', /^