From 10ab47c424fe776afce85535ef59dd1f06fb47db Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Sat, 5 Aug 2023 08:14:25 +0200 Subject: [PATCH] Add Bar and Bench (India) --- README.md | 1 + changelog.txt | 1 + contentScript.js | 18 ++++++++++++++++++ custom/manifest.json | 2 +- manifest.json | 3 ++- sites.js | 7 ++++++- sites_updated.json | 6 ++++++ 7 files changed, 35 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9d60ee0f..470609d5 100644 --- a/README.md +++ b/README.md @@ -851,6 +851,7 @@ Grouped in options:\ [The Star Malaysia](https://www.thestar.com.my) ##### India +[Bar and Bench](https://www.barandbench.com) - [BQ Prime](https://www.bqprime.com) - [Business Standard](https://www.business-standard.com) - [Hindu Tamil Thisai](https://www.hindutamil.in) - diff --git a/changelog.txt b/changelog.txt index 5bec17a2..b25198c6 100644 --- a/changelog.txt +++ b/changelog.txt @@ -4,6 +4,7 @@ Updates (install signed xpi-file): https://gitlab.com/magnolia1234/bypass-paywal Post-release Add Autocar.co.uk +Add Bar and Bench (India) Add Crikey.com.au Fix EUobserver (css) Fix Grupo Vocento (limit amp-redirect) diff --git a/contentScript.js b/contentScript.js index 758b1d90..fb76b215 100644 --- a/contentScript.js +++ b/contentScript.js @@ -3223,6 +3223,24 @@ else if (matchDomain('axios.com')) { csDoneOnce = true; } +else if (matchDomain('barandbench.com')) { + let paywall = document.querySelector('div#paywall-banner'); + 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.arr--story-page-card-wrapper'); + if (json_text && content) { + content.innerText = breakText(parseHtmlEntities(json_text)); + } + } + } + } +} + else if (matchDomain('barrons.com')) { let url = window.location.href; if (!url.includes('barrons.com/amp/')) { diff --git a/custom/manifest.json b/custom/manifest.json index 64db4ef7..8a2500e5 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -51,5 +51,5 @@ "webRequestBlocking", "*://*/*" ], - "version": "3.2.7.6" + "version": "3.2.7.7" } diff --git a/manifest.json b/manifest.json index 87ee3a7b..912400e0 100644 --- a/manifest.json +++ b/manifest.json @@ -92,6 +92,7 @@ "*://*.azcentral.com/*", "*://*.backpacker.com/*", "*://*.baltimoresun.com/*", + "*://*.barandbench.com/*", "*://*.barrons.com/*", "*://*.bd.nl/*", "*://*.belfasttelegraph.co.uk/*", @@ -773,5 +774,5 @@ "*://*.wyleex.com/*", "*://webcache.googleusercontent.com/*" ], - "version": "3.2.7.6" + "version": "3.2.7.7" } diff --git a/sites.js b/sites.js index 1185ba48..4a0fd3ec 100644 --- a/sites.js +++ b/sites.js @@ -206,10 +206,15 @@ var defaultSites = { block_regex: "\.axios\.com\/api\/v\d\/licenses" }, "Badische Neueste Nachrichten": { - allow_cookies: 1, domain: "bnn.de", + allow_cookies: 1, useragent: "googlebot" }, + "Bar and Bench": { + domain: "barandbench.com", + allow_cookies: 1, + cs_dompurify: 1 + }, "Barron's (when blocked disable Googlebot in BPC-settings)": { domain: "barrons.com", allow_cookies: 1, diff --git a/sites_updated.json b/sites_updated.json index 02a26348..f1586f27 100644 --- a/sites_updated.json +++ b/sites_updated.json @@ -40,6 +40,12 @@ "block_regex": "\\.automobilwoche\\.de\\/sites\\/camw\\/files\\/js\\/js_9G4.+\\.js", "upd_version": "3.2.6.6" }, + "Bar and Bench": { + "domain": "barandbench.com", + "allow_cookies": 1, + "ld_json": "div#paywall-banner|div.arr--story-page-card-wrapper", + "upd_version": "3.2.7.7" + }, "Bloomberg": { "domain": "bloomberg.com", "allow_cookies": 1,