From 3c8f10fea44126a3a9dcf20e73cbf2bc87c8c92d Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Mon, 27 Sep 2021 16:31:46 +0200 Subject: [PATCH] Remove Gazet van Antwerpen (obsolete) --- README.md | 1 - background.js | 3 +- changelog.txt | 1 + contentScript.js | 89 ------------------------------------- manifest.json | 3 +- options/options_custom.html | 2 +- sites.js | 1 - 7 files changed, 4 insertions(+), 96 deletions(-) diff --git a/README.md b/README.md index cf05df0..cd4f3e3 100644 --- a/README.md +++ b/README.md @@ -408,7 +408,6 @@ Grouped in options:\ [De Tijd](https://www.tijd.be) - [Financieele Dagblad](https://fd.nl) - [Follow the Money](https://www.ftm.nl) - -[Gazet van Antwerpen](https://www.gva.be) - [Groene Amsterdammer](https://www.groene.nl) - [Humo](https://www.humo.be) - [Knack](https://www.knack.be) - diff --git a/background.js b/background.js index b1df9dc..a610415 100644 --- a/background.js +++ b/background.js @@ -83,7 +83,6 @@ var allow_cookies_default = [ 'freiepresse.de', 'ftm.nl', 'gestion.pe', - 'gva.be', 'haaretz.co.il', 'haaretz.com', 'handelsblatt.com', @@ -1318,7 +1317,7 @@ if (matchUrlDomain(change_headers, details.url) && (!['font', 'image', 'styleshe } if ((!['font', 'stylesheet'].includes(details.type) || matchUrlDomain(cs_limit_except, currentTabUrl)) && !csDone) { let lib_file = 'lib/empty.js'; - if (matchUrlDomain(['bloomberg.com', 'cicero.de', 'economictimes.com', 'gva.be', 'lesechos.fr', 'newleftreview.org', 'newyorker.com', 'nzherald.co.nz', 'prospectmagazine.co.uk', 'sudouest.fr', 'techinasia.com', 'valor.globo.com', 'washingtonpost.com'].concat(nl_mediahuis_region_domains, no_nhst_media_domains, usa_theathletic_domains), currentTabUrl)) + if (matchUrlDomain(['bloomberg.com', 'cicero.de', 'economictimes.com', 'lesechos.fr', 'newleftreview.org', 'newyorker.com', 'nzherald.co.nz', 'prospectmagazine.co.uk', 'sudouest.fr', 'techinasia.com', 'valor.globo.com', 'washingtonpost.com'].concat(nl_mediahuis_region_domains, no_nhst_media_domains, usa_theathletic_domains), currentTabUrl)) lib_file = 'lib/purify.min.js'; ext_api.tabs.executeScript(tabId, { file: lib_file, diff --git a/changelog.txt b/changelog.txt index 445a7b5..36e1025 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ Changelog Bypass Paywalls Clean - Firefox Post-release +Remove Gazet van Antwerpen (obsolete) Fix Telerama.fr (mobile) * v2.3.7.0 (2021-09-26) diff --git a/contentScript.js b/contentScript.js index 82723df..21a9e96 100644 --- a/contentScript.js +++ b/contentScript.js @@ -1185,95 +1185,6 @@ else if (matchDomain('ftm.nl')) { removeDOMElement(banner_pp); } -else if (matchDomain('gva.be')) { - document.addEventListener('DOMContentLoaded', () => { - let paywall = document.querySelector('div[data-cj-root="subscription-wall"]'); - removeDOMElement(paywall); - if (paywall) { - let main_content = document.querySelector('div[data-mht-block="article-detail__article-main"]'); - let json_script = main_content.querySelector('script'); - let json_str = json_script.text.substring(json_script.textContent.indexOf('{')); - let json = JSON.parse(json_str); - let premium = Object.values(json)[0]['premium']; - if (json) { - let json_text = Object.values(json)[0]['data']['article']['body']; - let parser = new DOMParser(); - let div_content = main_content.querySelector('div'); - div_content.setAttribute('class', 'gva-6c6ea21_marginbottom5 gva-28c280e9_contentwrapper'); - let par_elem, par_key, par_li, par_html; - let head = document.querySelector('head'); - let streamone = false; - let flourish = false; - for (let par of json_text) { - for (let key in par) { - par_elem = document.createElement('p'); - par_key = par[key]; - if (['p', 'subhead'].includes(key)) { - if (par_key.includes('<')) { - par_html = parser.parseFromString('
' + DOMPurify.sanitize(par_key) + '
', 'text/html'); - par_elem = par_html.querySelector('p'); - } else - par_elem.innerText = par_key; - if (key === 'subhead') - par_elem.setAttribute('style', 'font-weight: bold;'); - } else if (key === 'image') { - par_elem = document.createElement('img'); - par_elem.src = par_key.url; - } else if (key === 'bullet_list') { - par_elem = document.createElement('ul'); - for (let bullet of par_key) { - par_html = parser.parseFromString('' + DOMPurify.sanitize(par_key) + '
', 'text/html'); - par_elem = par_html.querySelector('p'); - } - if (!['streamone', 'legacy-ml'].includes(key)) - par_elem.setAttribute('style', 'font-size: 16px;'); - div_content.appendChild(par_elem); - } - } - } - } - }); - window.setTimeout(function () { - let overlay = document.querySelector('div.cj-root'); - removeDOMElement(overlay); - let noscroll = document.querySelector('html.is-dialog-active'); - if (noscroll) - noscroll.classList.remove('is-dialog-active'); - }, 500); // Delay (in milliseconds) -} - else if (matchDomain('knack.be')) { let paywall = document.querySelector('.rmgPaywall'); if (paywall) { diff --git a/manifest.json b/manifest.json index 9ababfb..9d458f2 100644 --- a/manifest.json +++ b/manifest.json @@ -210,7 +210,6 @@ "*://*.griffithreview.com/*", "*://*.groene.nl/*", "*://*.grubstreet.com/*", - "*://*.gva.be/*", "*://*.gympietimes.com.au/*", "*://*.haaretz.co.il/*", "*://*.haaretz.com/*", @@ -561,5 +560,5 @@ "*://*.wallkit.net/*", "*://*.wsj.net/*" ], - "version": "2.3.7.0" + "version": "2.3.7.1" } \ No newline at end of file diff --git a/options/options_custom.html b/options/options_custom.html index 9d61ee9..a38fc3c 100644 --- a/options/options_custom.html +++ b/options/options_custom.html @@ -20,7 +20,7 @@