From 1cb9472e9f50bcf31ada494d76ceb08bf7f44d0d Mon Sep 17 00:00:00 2001 From: CaioWzy Date: Sat, 25 Jul 2020 11:35:11 -0300 Subject: [PATCH] =?UTF-8?q?Complementa=20implementa=C3=A7=C3=A3o=20para=20?= =?UTF-8?q?o=20Nexo=20Jornal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/background.js | 5 +++++ src/content-start.js | 20 ++++++++++++++++---- src/content.js | 14 ++++++++++++++ src/manifest.json | 6 ++++-- 4 files changed, 39 insertions(+), 6 deletions(-) diff --git a/src/background.js b/src/background.js index ea8d3aa..07e93d9 100644 --- a/src/background.js +++ b/src/background.js @@ -92,6 +92,11 @@ const BLOCKLIST = { urlFilter: '*://www.jota.info/*' } }, + nexo: { + xhrBlocking: [ + 'https://acesso.nexojornal.com.br/paywall/*' + ] + }, nsctotal: { xhrBlocking: [ 'https://paywall.nsctotal.com.br/behaviors', diff --git a/src/content-start.js b/src/content-start.js index 99c1133..7953210 100644 --- a/src/content-start.js +++ b/src/content-start.js @@ -117,10 +117,22 @@ const INJECTION = { nexo: { url: /nexojornal\.com\.br/, code: ` - var body = document.querySelector("body"); - var paywall_box = document.getElementsByClassName("PaywallBumper__wrap-container___3_kL1"); - paywall_box[0].remove(); - body.style.overflow = "auto" + style = document.createElement('style') + style.type = 'text/css' + + const css = \` + body { + overflow: auto !important; + } + + div[class*='PaywallBumper__wrap-container'], + div[class*='Datawall__wrap-container'] { + display: none !important; + } + \`; + + style.appendChild(document.createTextNode(css)) + document.head.appendChild(style) ` }, }; diff --git a/src/content.js b/src/content.js index f68e1fd..3d33291 100644 --- a/src/content.js +++ b/src/content.js @@ -38,6 +38,20 @@ const INJECTION = { setTimeout(showText, 100); ` }, + nexo: { + url: /nexojornal\.com\.br/, + code: ` + const selectors = [ + "div[class*='PaywallBumper__wrap-container'", + "div[class*='Datawall__wrap-container'" + ] + + selectors.forEach(selector => { + const element = document.querySelector(selector) + if (element) element.remove() + }) + ` + }, superinteressante: { url: /super.abril.com.br/, code: ABRIL_CODE diff --git a/src/manifest.json b/src/manifest.json index a28ad26..fa72e5d 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -26,7 +26,8 @@ "*://*.veja.abril.com.br/*", "*://*.jota.info/*", "*://*.diariodaregiao.com.br/*", - "*://*.correio24horas.com.br/*" + "*://*.correio24horas.com.br/*", + "*://*.nexojornal.com.br/*" ] }, { @@ -87,7 +88,8 @@ "*://*.diariodaregiao.com.br/*", "*://*.correio24horas.com.br/*", "*://correio-static.cworks.cloud/vendor/bower_components/paywall.js/paywall.js*", - "*://*.epoca.globo.com/*" + "*://*.epoca.globo.com/*", + "*://*.nexojornal.com.br/*" ], "applications": {