From 79cb52d6b9dbbdd98064797e9ddf458c44732836 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Mon, 14 Nov 2022 18:41:18 +0100 Subject: [PATCH] Add CNBC (Pro text) --- README.md | 1 + changelog.txt | 1 + contentScript.js | 15 +++++++++++++++ manifest.json | 3 ++- sites.js | 7 ++++++- sites_updated.json | 18 ++++++++++++++++++ 6 files changed, 43 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index aa63bb5b..40d1f007 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,7 @@ _* free articles only._ [Barron's](https://www.barrons.com) - [Bloomberg](https://www.bloomberg.com) - [Business Insider](https://www.businessinsider.com) - +[CNBC](https://www.cnbc.com) - [Digiday](https://digiday.com) - [Entrepreneur](https://www.entrepreneur.com) - [Forbes](https://www.forbes.com) - diff --git a/changelog.txt b/changelog.txt index e70fb759..5e29338b 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ Changelog Bypass Paywalls Clean - Firefox Post-release +Add CNBC (Pro text) Fix The Hill Times (text) * v2.9.3.0 (2022-11-13) diff --git a/contentScript.js b/contentScript.js index 783a50ce..11569580 100644 --- a/contentScript.js +++ b/contentScript.js @@ -2738,6 +2738,21 @@ else if (matchDomain(['chronicle.com', 'philanthropy.com'])) { } } +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 0px; 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'); + } + } +} + else if (matchDomain('csmonitor.com')) { let paywall = document.querySelector('div.paywall'); removeDOMElement(paywall); diff --git a/manifest.json b/manifest.json index 83c36a8b..483848eb 100644 --- a/manifest.json +++ b/manifest.json @@ -144,6 +144,7 @@ "*://*.cleveland.com/*", "*://*.climbing.com/*", "*://*.cmjornal.pt/*", + "*://*.cnbc.com/*", "*://*.codesports.com.au/*", "*://*.commentary.org/*", "*://*.commercialappeal.com/*", @@ -729,5 +730,5 @@ "*://gcm.omerlocdn.com/*", "*://webcache.googleusercontent.com/*" ], - "version": "2.9.3.1" + "version": "2.9.3.2" } diff --git a/sites.js b/sites.js index f6b6ae00..e84bc227 100644 --- a/sites.js +++ b/sites.js @@ -290,6 +290,11 @@ var defaultSites = { allow_cookies: 1, block_regex: /\.clarin\.com\/.+\/auth\d\.js/ }, + "CNBC": { + domain: "cnbc.com", + allow_cookies: 1, + block_regex: /\.tinypass\.com\// + }, "Commentary Magazine": { domain: "commentary.org", block_regex: /\.commentary\.org\/.+\/js\/dg-locker-public\.js/ @@ -2402,4 +2407,4 @@ init_custom_domains(); // sites with no fix (background) var be_mediahuis_nofix_domains = ['gva.be', 'hbvl.be']; var it_gedi_nofix_domains = ['gelocal.it', 'huffingtonpost.it', 'ilsecoloxix.it', 'lastampa.it', 'limesonline.com']; -var nofix_sites = ['africaintelligence.com', 'africaintelligence.fr', 'aftenposten.no', 'bild.de', 'borsen.dk', 'businesstimes.com.sg', 'caixin.com', 'caixinglobal.com', 'caravanmagazine.in', 'cnbc.com', 'courrierinternational.com', 'dn.no', 'dn.se', 'elordenmundial.com', 'epw.in', 'expresso.pt', 'ftchinese.com', 'handelsblatt.com', 'hs.fi', 'ilsole24ore.com', 'jacobinmag.com', 'jeuneafrique.com', 'kurier.at', 'lavozdegalicia.es', 'leconomiste.com', 'lefigaro.fr', 'lemonde.fr', 'lepoint.fr', 'letemps.ch', 'liberation.fr', 'medianama.com', 'milanofinanza.it', 'mondediplo.com', 'moneycontrol.com', 'nature.com', 'nbr.co.nz', 'ouest-france.fr', 'politiken.dk', 'pressreader.com', 'publico.pt', 'republic.ru', 'statnews.com', 'stern.de', 'straitstimes.com', 'sueddeutsche.de', 'tagesanzeiger.ch', 'the-ken.com', 'theinformation.com', ' themorningcontext.com', 'theparisreview.org', 'thewirechina.com', 'welt.de', 'worldpoliticsreview.com', 'ynet.co.il', 'zerohedge.com'].concat(be_mediahuis_nofix_domains, it_gedi_nofix_domains); +var nofix_sites = ['africaintelligence.com', 'africaintelligence.fr', 'aftenposten.no', 'bild.de', 'borsen.dk', 'businesstimes.com.sg', 'caixin.com', 'caixinglobal.com', 'caravanmagazine.in', 'courrierinternational.com', 'dn.no', 'dn.se', 'elordenmundial.com', 'epw.in', 'expresso.pt', 'ftchinese.com', 'handelsblatt.com', 'hs.fi', 'ilsole24ore.com', 'jacobinmag.com', 'jeuneafrique.com', 'kurier.at', 'lavozdegalicia.es', 'leconomiste.com', 'lefigaro.fr', 'lemonde.fr', 'lepoint.fr', 'letemps.ch', 'liberation.fr', 'medianama.com', 'milanofinanza.it', 'mondediplo.com', 'moneycontrol.com', 'nature.com', 'nbr.co.nz', 'ouest-france.fr', 'politiken.dk', 'pressreader.com', 'publico.pt', 'republic.ru', 'statnews.com', 'stern.de', 'straitstimes.com', 'sueddeutsche.de', 'tagesanzeiger.ch', 'the-ken.com', 'theinformation.com', ' themorningcontext.com', 'theparisreview.org', 'thewirechina.com', 'welt.de', 'worldpoliticsreview.com', 'ynet.co.il', 'zerohedge.com'].concat(be_mediahuis_nofix_domains, it_gedi_nofix_domains); diff --git a/sites_updated.json b/sites_updated.json index 4b949035..753db768 100644 --- a/sites_updated.json +++ b/sites_updated.json @@ -1,4 +1,22 @@ { + "CNBC": { + "domain": "cnbc.com", + "allow_cookies": 1, + "block_regex": "\\.tinypass\\.com\\/", + "cs_code": [{ + "cond": "div.ArticleGate-proGate", + "rm_elem": 1, + "elems": [{ + "cond": "span[hidden]", + "rm_attrib": "class" + }, { + "cond": "span[hidden]", + "rm_attrib": "hidden" + } + ] + }], + "new_site": 1 + }, "Correio da Manhã": { "domain": "cmjornal.pt", "allow_cookies": 1,