From 151ac603c23f47b4f9453d9b997229b95333fa06 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Sun, 17 Sep 2023 18:43:44 +0200 Subject: [PATCH] Add Vikatan (India) --- README.md | 3 ++- background.js | 2 +- changelog.txt | 1 + contentScript.js | 26 ++++++++++++++++++++++++++ custom/manifest.json | 2 +- custom/sites_custom.json | 16 ++++++++++------ manifest.json | 3 ++- sites.js | 5 +++++ sites_updated.json | 7 +++++++ 9 files changed, 55 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 906b4196..d3ca1b9e 100644 --- a/README.md +++ b/README.md @@ -892,7 +892,8 @@ Grouped in options:\ [The Indian Express](https://indianexpress.com) - [The News Minute](https://www.thenewsminute.com) - [The Quint](https://www.thequint.com) - -[Times of India](https://timesofindia.indiatimes.com) +[Times of India](https://timesofindia.indiatimes.com) - +[Vikatan](https://www.vikatan.com) ##### Israel [Globes](https://www.globes.co.il) - diff --git a/background.js b/background.js index 9df414de..7a3024ee 100644 --- a/background.js +++ b/background.js @@ -373,7 +373,7 @@ function set_rules(sites, sites_updated, sites_custom) { if (!custom) { let isCustomSite = matchDomain(customSites_domains, domain); let customSite_title = isCustomSite ? Object.keys(customSites).find(key => customSites[key].domain === isCustomSite) : ''; - if (customSite_title && !(rule.add_ext_link || ['swarajyamag.com'].includes(isCustomSite))) { + if (customSite_title && !(rule.add_ext_link || ['swarajyamag.com', 'vikatan.com'].includes(isCustomSite))) { // add default block_regex let block_regex_default = ''; if (rule.hasOwnProperty('block_regex')) diff --git a/changelog.txt b/changelog.txt index d41ef7f2..9992f270 100644 --- a/changelog.txt +++ b/changelog.txt @@ -5,6 +5,7 @@ Updates (install signed xpi-file): https://gitlab.com/magnolia1234/bypass-paywal Post-release Add Cambio Colombia Add The News Minute (India) +Add Vikatan (India) Fix LaStampa.it (video articles) Fix Roularta Media Group (modal) Fix South China Morning Post (mobile & amp) diff --git a/contentScript.js b/contentScript.js index 0c47dbdf..af2ffa6c 100644 --- a/contentScript.js +++ b/contentScript.js @@ -5381,6 +5381,32 @@ else if (matchDomain('venturebeat.com')) { }, 500); } +else if (matchDomain('vikatan.com')) { + window.setTimeout(function () { + let paywall = document.querySelector('div#paywallDisplay'); + if (paywall && dompurify_loaded) { + removeDOMElement(paywall); + let json_script = getArticleJsonScript(); + if (json_script) { + let json = JSON.parse(json_script.text); + if (json) { + let json_text = parseHtmlEntities(json.articleBody); + let content = document.querySelector('div.story-element > div'); + if (json_text && content) { + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + DOMPurify.sanitize(json_text) + '
', 'text/html'); + let content_new = doc.querySelector('div'); + content.parentNode.replaceChild(content_new, content); + } + } + } + } + let story_hidden = document.querySelector('div[class^="styles-m__story-card-wrapper_"]'); + if (story_hidden) + story_hidden.removeAttribute('class'); + }, 500); +} + else if (matchDomain('washingtonpost.com')) { let leaderboard = document.querySelector('#leaderboard-wrapper'); let ads = document.querySelectorAll('div[data-qa$="-ad"]'); diff --git a/custom/manifest.json b/custom/manifest.json index 18db3f86..163c405e 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -51,5 +51,5 @@ "webRequestBlocking", "*://*/*" ], - "version": "3.3.3.6" + "version": "3.3.3.7" } diff --git a/custom/sites_custom.json b/custom/sites_custom.json index 38d95e10..919d2901 100644 --- a/custom/sites_custom.json +++ b/custom/sites_custom.json @@ -149,6 +149,11 @@ "block_regex": "\\.tinypass\\.com", "domain": "eluniversal.com.mx" }, + "Endpts.com": { + "allow_cookies": 1, + "domain": "endpts.com", + "ld_json_url": "div.epn_limit|div.epn_content" + }, "Energy-storage.news": { "allow_cookies": 1, "domain": "energy-storage.news", @@ -459,6 +464,11 @@ "Quickmath.com": { "domain": "quickmath.com" }, + "Researchprofessionalnews.com": { + "allow_cookies": 1, + "domain": "researchprofessionalnews.com", + "ld_json_url": "section.single-locked-message|section.single-locked-content" + }, "Reviewjournal.com": { "allow_cookies": 1, "block_regex": "js\\.matheranalytics\\.com", @@ -621,12 +631,6 @@ "block_regex": "\\.toolkits\\.com\\/app\\/js\\/api\\.min\\.js", "domain": "toolkits.com" }, - "Vikatan.com": { - "allow_cookies": 1, - "cs_code": "[{\"cond\":\"div[class^='styles-m__story-card-wrapper_']\", \"rm_attrib\":\"class\"}]", - "domain": "vikatan.com", - "ld_json": "div#paywallDisplay|div.story-element>div" - }, "Washingtontimes.com": { "allow_cookies": 1, "block_regex": "\\.tinypass\\.com", diff --git a/manifest.json b/manifest.json index f9e94276..773ea829 100644 --- a/manifest.json +++ b/manifest.json @@ -719,6 +719,7 @@ "*://*.varmatin.com/*", "*://*.vegetariantimes.com/*", "*://*.venturebeat.com/*", + "*://*.vikatan.com/*", "*://*.vn.nl/*", "*://*.vogue.com/*", "*://*.voguebusiness.com/*", @@ -794,5 +795,5 @@ "*://*.wyleex.com/*", "*://webcache.googleusercontent.com/*" ], - "version": "3.3.3.6" + "version": "3.3.3.7" } diff --git a/sites.js b/sites.js index 9496e5fc..e1a39e80 100644 --- a/sites.js +++ b/sites.js @@ -2447,6 +2447,11 @@ var defaultSites = { block_regex: /cdn\.cxense\.com\//, useragent: "googlebot" }, + "Vikatan": { + domain: "vikatan.com", + allow_cookies: 1, + cs_dompurify: 1 + }, "Vogue Business": { allow_cookies: 1, domain: "voguebusiness.com", diff --git a/sites_updated.json b/sites_updated.json index f1040ed7..3c366bcd 100644 --- a/sites_updated.json +++ b/sites_updated.json @@ -110,5 +110,12 @@ "remove_cookies_select_drop": ["blaize_session"], "ld_json_url": "div#zephr-payment-form-root|div.entry-content|1", "upd_version": "3.3.2.5" + }, + "Vikatan": { + "domain": "vikatan.com", + "allow_cookies": 1, + "ld_json": "div#paywallDisplay|div.story-element>div", + "cs_code": "[{\"cond\":\"div[class^='styles-m__story-card-wrapper_']\", \"rm_attrib\":\"class\"}]", + "upd_version": "3.3.3.7" } }