From 9b25b8ecaba7941c0c226d88e67813d99ecc8056 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Fri, 8 Jul 2022 08:10:35 +0200 Subject: [PATCH] Add Outlook Business (India) --- README.md | 1 + background.js | 2 +- changelog.txt | 1 + contentScript.js | 22 ++++++++++++++++++++++ manifest.json | 3 ++- sites.js | 4 ++++ 6 files changed, 31 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 351ce29..08e83af 100644 --- a/README.md +++ b/README.md @@ -719,6 +719,7 @@ Grouped in options:\ [MediaNama](https://www.medianama.com) - [Mid-Day](https://www.mid-day.com) - [Outlook](https://www.outlookindia.com) - +[Outlook Business](https://www.outlookbusiness.com) - [The Economic Times (ET Prime)](https://economictimes.indiatimes.com) - [The Financial Express](https://www.financialexpress.com) - [The Hindu](https://www.thehindu.com) - diff --git a/background.js b/background.js index 4a2b983..e53270e 100644 --- a/background.js +++ b/background.js @@ -6,7 +6,7 @@ var ext_name = manifestData.name; var ext_version = manifestData.version; const cs_limit_except = ['elespanol.com', 'faz.net', 'nation.africa', 'nationalgeographic.com', 'thetimes.co.uk']; -const dompurify_sites = ['asiatimes.com', 'bloomberg.com', 'cicero.de', 'economictimes.com', 'hs.fi', 'ilmanifesto.it', 'iltalehti.fi', 'ipolitics.ca', 'italiaoggi.it', 'lesechos.fr', 'marianne.net', 'newleftreview.org', 'nzherald.co.nz', 'prospectmagazine.co.uk', 'stratfor.com', 'techinasia.com', 'theathletic.com', 'timesofindia.com', 'vn.nl'].concat(be_mediahuis_domains, nl_mediahuis_region_domains, no_nhst_media_domains); +const dompurify_sites = ['asiatimes.com', 'bloomberg.com', 'cicero.de', 'economictimes.com', 'hs.fi', 'ilmanifesto.it', 'iltalehti.fi', 'ipolitics.ca', 'italiaoggi.it', 'lesechos.fr', 'marianne.net', 'newleftreview.org', 'nzherald.co.nz', 'outlookbusiness.com', 'prospectmagazine.co.uk', 'stratfor.com', 'techinasia.com', 'theathletic.com', 'timesofindia.com', 'vn.nl'].concat(be_mediahuis_domains, nl_mediahuis_region_domains, no_nhst_media_domains); var currentTabUrl = ''; var csDone = false; var optin_setcookie = false; diff --git a/changelog.txt b/changelog.txt index e3f2159..7549def 100644 --- a/changelog.txt +++ b/changelog.txt @@ -4,6 +4,7 @@ Changelog Bypass Paywalls Clean - Firefox Post-release Add Architectural Digest (Conde Nast) Add Handelszeitung.ch +Add Outlook Business (India) Fix ABC.es (mobile) Fix Knack.be & LeVif.be (subdomains-text) Fix SOFREP (plus) diff --git a/contentScript.js b/contentScript.js index 64d9db8..65383bf 100644 --- a/contentScript.js +++ b/contentScript.js @@ -3295,6 +3295,28 @@ else if (matchDomain('nzherald.co.nz')) { removeDOMElement(premium_toaster); } +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 && dompurify_loaded) { + 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('