From 4e78be92e39d409f0f8db97bb52f12263c95d88d Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Tue, 15 Dec 2020 17:03:17 +0100 Subject: [PATCH] Fix-update Tech in Asia (homepage) --- background.js | 10 ++++++---- changelog.txt | 1 + contentScript.js | 10 ++++------ manifest.json | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/background.js b/background.js index e4937ef..e2273e9 100644 --- a/background.js +++ b/background.js @@ -4,7 +4,7 @@ var ext_api = (typeof browser === 'object') ? browser : chrome; var ext_name = ext_api.runtime.getManifest().name; -const cs_limit_except = ['afr.com', 'harpers.org', 'la-croix.com', 'lescienze.it']; +const cs_limit_except = ['afr.com', 'harpers.org', 'la-croix.com', 'lescienze.it', 'techinasia.com']; var currentTabUrl = ''; var csDone = false; @@ -13,7 +13,7 @@ var csDone = false; // var defaultSites = {}; const restrictions = { - 'barrons.com': /.+barrons\.com\/(amp\/)?article(s)?\/.+/, + 'barrons.com': /.+\.barrons\.com\/(amp\/)?article(s)?\/.+/, 'bloombergquint.com': /^((?!\.bloombergquint\.com\/bq-blue-exclusive\/).)*$/, 'elcomercio.pe': /.+\/elcomercio\.pe\/.+((\w)+(\-)+){3,}.+/, 'faz.net': /^((?!\/zeitung\.faz\.net\/).)*$/, @@ -22,7 +22,8 @@ const restrictions = { 'hs.fi': /^((?!\/.+\.hs\.fi\/paivanlehti\/).)*$/, 'globo.com': /^((?!\/valor\.globo\.com\/).)*$/, 'quora.com': /^((?!quora\.com\/search\?q=).)*$/, - 'seekingalpha.com': /.+seekingalpha\.com\/article\/.+/, + 'seekingalpha.com': /.+\/seekingalpha\.com\/article\/.+/, + 'techinasia.com': /.+\.techinasia\.com\/.+((\w)+(\-)+){3,}.+/, 'wsj.com': /^((?!\/cn\.wsj\.com\/).)*$/ } @@ -119,6 +120,7 @@ const remove_cookies_select_hold = { 'groene.nl': ['accept-cookies', 'popunder-hidden'], 'newstatesman.com': ['STYXKEY_nsversion'], 'seattletimes.com': ['st_newsletter_splash_seen'], + 'telegraaf.nl': 'euconsent-v2', 'telegraph.co.uk': ['consentUUID'], 'qz.com': ['gdpr'], 'wsj.com': ['wsjregion', 'ResponsiveConditional_initialBreakpoint'] @@ -973,7 +975,7 @@ function popup_show_toggle_tab(callback) { // remove cookies after page load ext_api.webRequest.onCompleted.addListener(function (details) { var domainVar = matchUrlDomain(remove_cookies, details.url); - if (!domainVar || !enabledSites.includes(domainVar)) + if ((!['main_frame', 'xmlhttprequest', 'other'].includes(details.type)) || !domainVar || !enabledSites.includes(domainVar)) return; ext_api.cookies.getAll({ domain: domainVar diff --git a/changelog.txt b/changelog.txt index 79d0625..23bd71c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ Changelog Bypass Paywalls Clean - Firefox Post-release +Fix-update Tech in Asia (homepage) Fix show update (amo-version) * v1.9.9.0 (2020-12-13) diff --git a/contentScript.js b/contentScript.js index d30d1ba..17163dd 100644 --- a/contentScript.js +++ b/contentScript.js @@ -555,13 +555,11 @@ else if (matchDomain("hbr.org")) { } else if (matchDomain("techinasia.com")) { - const paywall = document.querySelector('.paywall-content'); - if (paywall){ + let paywall = document.querySelector('.paywall-content'); + if (paywall) paywall.classList.remove('paywall-content'); - csDone = true; - } - const splash_subscribe = document.querySelector('.splash-subscribe'); - const paywall_hard = document.querySelector('.paywall-hard'); + let splash_subscribe = document.querySelector('.splash-subscribe'); + let paywall_hard = document.querySelector('.paywall-hard'); removeDOMElement(splash_subscribe, paywall_hard); } diff --git a/manifest.json b/manifest.json index 5af1b22..391697c 100644 --- a/manifest.json +++ b/manifest.json @@ -408,5 +408,5 @@ "*://*.repstatic.it/*", "*://*.userzoom.com/*" ], - "version": "1.9.9.0" + "version": "1.9.9.1" } \ No newline at end of file