From ebb83cc7f4f9c1a4678a251a7ad7d52760800e0b Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Fri, 20 Dec 2019 19:13:21 +0100 Subject: [PATCH] Fix Caixin Global Fix for subscription messages while scrolling multiple articles on one page. --- README.md | 12 ++++++------ background.js | 6 ++++-- contentScript.js | 6 +++++- options.js | 2 +- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index a1c24de..3d7fc96 100644 --- a/README.md +++ b/README.md @@ -10,21 +10,21 @@ [Bloomberg](https://www.bloomberg.com)\ [Bloomberg Quint](https://www.bloombergquint.com)\ [Business Insider](https://www.businessinsider.com)\ -[Caixin](https://www.caixinglobal.com)\ +[Caixin Global](https://www.caixinglobal.com)\ [Chemical & Engineering News](https://cen.acs.org)\ [Central Western Daily](https://www.centralwesterndaily.com.au)\ [Chicago Tribune](https://www.chicagotribune.com)\ [Crain's Chicago Business](https://www.chicagobusiness.com)\ [Corriere Della Sera](https://www.corriere.it)\ [Daily Press](https://www.dailypress.com)\ -[DeMorgen](https://demorgen.be)\ +[DeMorgen](https://www.demorgen.be)\ [Denver Post](https://www.denverpost.com)\ [De Groene Amsterdammer](https://www.groene.nl)\ [De Tijd](https://www.tijd.be)\ [de Volkskrant](https://www.volkskrant.nl)\ [ET Prime](https://prime.economictimes.indiatimes.com/)\ [The Economist](https://www.economist.com)\ -[Eindhovens Dagblad](https://ed.nl)\ +[Eindhovens Dagblad](https://www.ed.nl)\ [Examiner](https://www.examiner.com.au)\ [Financial Times](https://www.ft.com)\ [Foreign Policy](https://www.foreignpolicy.com)\ @@ -41,7 +41,7 @@ [Le Monde](https://www.lemonde.fr)\ [Le Parisien](http://www.leparisien.fr)\ [Le Temps](https://www.letemps.ch)\ -[London Review of Books](https://lrb.co.uk)\ +[London Review of Books](https://www.lrb.co.uk)\ [Los Angeles Times](https://www.latimes.com)\ [Medium](https://www.medium.com)\ [Medscape](https://www.medscape.com)\ @@ -84,7 +84,7 @@ [The New York Times](https://www.nytimes.com)\ [The New Yorker](https://www.newyorker.com)\ [The News-Gazette](https://www.news-gazette.com)\ -[The Philadelphia Inquirer](https://inquirer.com)\ +[The Philadelphia Inquirer](https://www.inquirer.com)\ [The Saturday Paper](https://www.thesaturdaypaper.com.au)\ [The Spectator](https://www.spectator.co.uk)\ [The Seattle Times](https://www.seattletimes.com)\ @@ -122,7 +122,7 @@ Usually premium articles cannot be bypassed as they are behind a hard paywall. * This add-on works best alongside [uBlock Origin](https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/). * If a site doesn't work try turning off uBlock and refreshing. -### Pull Requesets +### Pull Requests * PRs are welcome. ### Show your support diff --git a/background.js b/background.js index b14c4cd..4ed8a43 100644 --- a/background.js +++ b/background.js @@ -7,7 +7,7 @@ var defaultSites = { 'Bloomberg': 'bloomberg.com', 'Bloomberg Quint': 'bloombergquint.com', 'Business Insider': 'businessinsider.com', - 'Caixin': 'caixinglobal.com', + 'Caixin Global': 'caixinglobal.com', 'Chemical & Engineering News': 'cen.acs.org', 'Chicago Tribune': 'chicagotribune.com', 'Central Western Daily': 'centralwesterndaily.com.au', @@ -110,6 +110,7 @@ const allow_cookies = [ 'ad.nl', 'asia.nikkei.com', 'bostonglobe.com', +'caixinglobal.com', 'cen.acs.org', 'chicagobusiness.com', 'demorgen.be', @@ -155,6 +156,7 @@ const remove_cookies = [ 'asia.nikkei.com', 'bloombergquint.com', 'bostonglobe.com', +'caixinglobal.com', 'cen.acs.org', 'chicagobusiness.com', 'demorgen.be', @@ -171,7 +173,6 @@ const remove_cookies = [ 'mercurynews.com', 'newstatesman.com', 'nymag.com', -'nytimes.com', 'ocregister.com', 'qz.com', 'scientificamerican.com', @@ -197,6 +198,7 @@ const remove_cookies_select_hold = { const remove_cookies_select_drop = { 'ad.nl': ['temptationTrackingId'], 'bostonglobe.com': ['FMPaywall'], + 'caixinglobal.com': ['CAIXINGLB_LOGIN_UUID'], 'demorgen.be': ['TID_ID'], 'economist.com': ['rvuuid'], 'ed.nl': ['temptationTrackingId'], diff --git a/contentScript.js b/contentScript.js index 2ac575e..9e6eca9 100644 --- a/contentScript.js +++ b/contentScript.js @@ -170,10 +170,14 @@ if (window.location.href.indexOf("nytimes.com") !== -1) { } if (window.location.href.indexOf("caixinglobal.com") !== -1) { + const pay_tip = document.querySelectorAll('.cons-pay-tip'); + for (let i = 0; i < pay_tip.length; i++) { + pay_tip[i].removeAttribute('style'); + } const appContent = document.getElementById('appContent'); if (appContent) { const p_hidden = document.querySelectorAll('p:not([style="display:block;"]'); - for (var i = 0; i < p_hidden.length; i++) { + for (let i = 0; i < p_hidden.length; i++) { p_hidden[i].setAttribute('style', 'display:block;'); } } diff --git a/options.js b/options.js index 19fbbbe..5a56330 100644 --- a/options.js +++ b/options.js @@ -5,7 +5,7 @@ var defaultSites = { 'Bloomberg': 'bloomberg.com', 'Bloomberg Quint': 'bloombergquint.com', 'Business Insider': 'businessinsider.com', - 'Caixin': 'caixinglobal.com', + 'Caixin Global': 'caixinglobal.com', 'Chemical & Engineering News': 'cen.acs.org', 'Chicago Tribune': 'chicagotribune.com', 'Central Western Daily': 'centralwesterndaily.com.au',