diff --git a/src/background.js b/src/background.js index 57fb5d7..56e9831 100644 --- a/src/background.js +++ b/src/background.js @@ -83,8 +83,7 @@ const BLOCKLIST = { gauchazh: { scriptBlocking: [ '*://gauchazh.clicrbs.com.br/static/main*', - '*://www.rbsonline.com.br/cdn/scripts/special-paywall.min.js*', - '*://www.rbsonline.com.br/cdn/scripts/paywall.min.js*', + '*://gauchazh.clicrbs.com.br/static/signwall.*.min.js' ] }, jornalnh: { diff --git a/src/content-start.js b/src/content-start.js index 3f53e35..1598487 100644 --- a/src/content-start.js +++ b/src/content-start.js @@ -50,36 +50,51 @@ const INJECTION = { gauchazh: { url : /gauchazh.clicrbs.com.br/, code: ` - function patchJs(jsurl) { - var xhttp = new XMLHttpRequest(); - xhttp.onreadystatechange = function() { - if (this.readyState == 4 && this.status == 200) { - var injectme = this.responseText; - injectme = injectme.replace(/[a-z].showLoginPaywall,/g, 'false,'); - injectme = injectme.replace(/[a-z].showPaywall,/g, 'false,'); - injectme = injectme.replace(/[a-z].requestCPF\\|\\|!1,/g, 'false,'); - injectme = injectme.replace( - /![a-z].showLoginPaywall&&![a-z].showPaywall\\|\\|!1/g, 'true'); - injectme = injectme.replace('throw new Error("only one instance of babel-polyfill is allowed");', ''); - var script = document.createElement("script"); - script.type = "text/javascript"; - var textNode = document.createTextNode(injectme); - script.appendChild(textNode); - document.head.appendChild(script); - } - }; - xhttp.open("GET", jsurl, true); - xhttp.send(); - } + document.addEventListener('DOMContentLoaded', function() { + function patchJs(jsurl) { + var xhttp = new XMLHttpRequest(); + xhttp.onreadystatechange = function() { + if (this.readyState == 4 && this.status == 200) { + var injectme = this.responseText; + injectme = injectme.replace( + /![a-z].showLoginPaywall&&![a-z].showPaywall\\|\\|!1/g, 'true'); + injectme = injectme.replace('throw new Error("only one instance of babel-polyfill is allowed");', ''); + var script = document.createElement("script"); + script.type = "text/javascript"; + var textNode = document.createTextNode(injectme); + script.appendChild(textNode); + document.head.appendChild(script); + } + }; + xhttp.open("GET", jsurl.replace('.com.br', '.com.br.'), true); + xhttp.send(); + } - document.addEventListener("DOMContentLoaded", function(event) { - var scripts = Array.from(document.getElementsByTagName('script')); - var script = scripts.find((el) => { - return el.src.includes('static/main') - }); - if (script) + const scripts = Array.from(document.getElementsByTagName('script')); + const script = scripts.find((el) => { return el.src.includes('static/main'); }); + if (script) { patchJs(script.src); + } }); + + window.onload = function() { + function check(){ + if(document.getElementsByClassName('wrapper-paid-content')[0]){ + document.getElementsByClassName('wrapper-paid-content')[0].innerHTML = '

Por favor aperte Ctrl-F5 para carregar o restante da notícia!

'; + } + setTimeout(function(){ check(); }, 5000); + } + check(); + }; + + const cleanPaywallTracking = () => { + document.cookie = 'pwsi__zh=;domain=.clicrbs.com.br;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT'; + localStorage.removeItem('pwsi__zh'); + sessionStorage.removeItem('pwsi__zh'); + }; + cleanPaywallTracking(); + setTimeout(cleanPaywallTracking, 5000); + document.body.addEventListener('click', cleanPaywallTracking, true); ` }, oglobo: { diff --git a/src/manifest.json b/src/manifest.json index ee74cca..4020993 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "burlesco", - "version": "12.0", + "version": "12.1", "description": "Leia notícias sem ser assinante, burle o paywall", "homepage_url": "https://burles.co", "author": "rodorgas", @@ -61,6 +61,7 @@ "*://*.folha.uol.com.br/*", "*://*.folha.com.br/*", "*://gauchazh.clicrbs.com.br/*", + "*://gauchazh.clicrbs.com.br./*", "*://*.zh.clicrbs.com.br/*", "*://api.clicrbs.com.br/*", "*://*.gazetadopovo.com.br/*",