From fb12a6beca147d3d9b1078e5994e20699174feb2 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Fri, 21 May 2021 15:10:39 +0200 Subject: [PATCH] Fix-update Valor Economico (Google webcache) --- README.md | 4 ++-- background.js | 1 - changelog.txt | 1 + contentScript.js | 12 +++++++++++- manifest.json | 2 +- sites.js | 2 +- 6 files changed, 16 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 5b38abd..15a522b 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,7 @@ _* free articles only._ [Loeb Classical Library](https://www.loebclassics.com) - [Philosophy Now](https://philosophynow.org) - [Quora](https://www.quora.com) - -[Scribd](http://www.scribd.com) - +[Scribd](https://www.scribd.com) - [Slader](https://www.slader.com) - [Statista](https://www.statista.com) @@ -554,7 +554,7 @@ Grupo Vocento (ABC) regional sites like [Folha de S. Paulo](https://www.folha.uol.com.br) - [O Estado de S. Paulo](https://estadao.com.br) - [O Globo](https://oglobo.globo.com) - -[Valor Econômico](https://valor.globo.com)* +[Valor Econômico](https://valor.globo.com) ##### Chile [Diario Financiero](https://www.df.cl) - [El Mercurio](https://digital.elmercurio.com) - diff --git a/background.js b/background.js index 69b54f1..6c1cdcc 100644 --- a/background.js +++ b/background.js @@ -24,7 +24,6 @@ const restrictions = { 'foreignaffairs.com': /.+\.foreignaffairs\.com\/(articles|fa-caching|interviews|reviews|sites)\/.+/, 'ft.com': /.+\.ft\.com\/content\//, 'gestion.pe': /.+\/gestion\.pe\/.+((\w)+(\-)+){3,}.+/, - 'globo.com': /^((?!\/valor\.globo\.com\/).)*$/, 'medianama.com': /\.medianama\.com\/(\d){4}\/(\d){2}\//, 'timesofindia.com': /.+\.timesofindia\.com\/($|toi-plus(\/.+)?|.+\.cms)/, 'nknews.org': /^((?!nknews\.org\/pro\/).)*$/, diff --git a/changelog.txt b/changelog.txt index 1fe255f..e264aae 100644 --- a/changelog.txt +++ b/changelog.txt @@ -5,6 +5,7 @@ Post-release Add MediaNama (India) Fix-update Prensa Iberica Fix-update The Economic Times (mobile/India) +Fix-update Valor Economico (Google webcache) * v2.2.1.0 (2021-05-16) Add Las Provincias (Spain) diff --git a/contentScript.js b/contentScript.js index 3ea6497..8d10ab2 100644 --- a/contentScript.js +++ b/contentScript.js @@ -1475,7 +1475,7 @@ else if (matchDomain('thetimes.co.uk')) { else if (!matchDomain(['belfasttelegraph.co.uk', 'independent.ie'])) csDone = true; -} else if (window.location.hostname.match(/\.(br|cl|pe)$/) || matchDomain(['elmercurio.com', 'latercera.com', 'lasegunda.com'])) {//south america +} else if (window.location.hostname.match(/\.(br|cl|pe)$/) || matchDomain(['elmercurio.com', 'latercera.com', 'lasegunda.com', 'valor.globo.com'])) {//south america if (matchDomain(['elcomercio.pe', 'gestion.pe'])) { let paywall = document.querySelector('.story-content__nota-premium'); @@ -1536,6 +1536,16 @@ else if (matchDomain(["mercuriovalpo.cl", "estrellavalpo.cl"])) { body_modal.classList.remove('modal-open'); } +else if (matchDomain('valor.globo.com')) { + let url = window.location.href; + let paywall = document.querySelector('div.paywall'); + if (paywall) { + removeDOMElement(paywall); + let url_cache = 'https://webcache.googleusercontent.com/search?q=cache:' + url; + replaceDomElementExt(url_cache, true, false, 'div.mc-article-body', 'Failed to load from Google webcache: '); + } +} + else csDone = true; diff --git a/manifest.json b/manifest.json index 07c6d4b..8d635b0 100644 --- a/manifest.json +++ b/manifest.json @@ -517,5 +517,5 @@ "*://*.wallkit.net/*", "*://*.wsj.net/*" ], - "version": "2.2.1.3" + "version": "2.2.1.4" } \ No newline at end of file diff --git a/sites.js b/sites.js index 834b6e1..4a94e0d 100644 --- a/sites.js +++ b/sites.js @@ -191,7 +191,7 @@ var defaultSites = "NRC Handelsblad": "nrc.nl", "NyTeknik": "nyteknik.se", "O Estado de S. Paulo": "estadao.com.br", - "O Globo": "globo.com", + "O Globo (& Valor Econômico)": "globo.com", "Observador.pt": "observador.pt", "Orange County Register": "ocregister.com", "Palo Alto Online": "paloaltoonline.com",