Skip to content

Commit

Permalink
Merge pull request #38 from burlesco/fix/gauchazh
Browse files Browse the repository at this point in the history
Corrige GaúchaZH
  • Loading branch information
rodorgas authored Jun 25, 2022
2 parents 4b169bb + f2837db commit b5642b2
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/burlesco.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
// @match *://*.nytimes.com/*
// @match *://*.nyt.com/*
// @match *://*.oglobo.globo.com/*
// @match *://www.rbsonline.com.br/*
// @match *://api.tinypass.com/*
// @match *://cdn.tinypass.com/*
// @match *://dashboard.tinypass.com/*
Expand Down Expand Up @@ -77,14 +76,12 @@
// @webRequestItem {"selector":"*://correio.rac.com.br/includes/js/novo_cp/fivewall.js*","action":"cancel"}
// @webRequestItem {"selector":"*://dashboard.tinypass.com/xbuilder/experience/load*","action":"cancel"}
// @webRequestItem {"selector":"*://*.fivewall.com.br/*","action":"cancel"}
// @webRequestItem {"selector":"*://www.rbsonline.com.br/cdn/scripts/SLoader.js","action":"cancel"}
// @webRequestItem {"selector":"*://*.nytimes.com/js/mtr.js","action":"cancel"}
// @webRequestItem {"selector":"*://*.washingtonpost.com/wp-stat/pwapi/*","action":"cancel"}
// @webRequestItem {"selector":"*://cdn.tinypass.com/api/tinypass.min.js","action":"cancel"}
// @webRequestItem {"selector":"*://api.tinypass.com/*","action":"cancel"}
// @webRequestItem {"selector":"*://tm.jsuol.com.br/modules/content-gate.js","action":"cancel"}
// @webRequestItem {"selector":"*://gauchazh.clicrbs.com.br/static/main*","action":"cancel"}
// @webRequestItem {"selector":"*://www.rbsonline.com.br/cdn/scripts/special-paywall.min.js*","action":"cancel"}
// @webRequestItem {"selector":"https://paywall.nsctotal.com.br/behaviors","action":"cancel"}
// @webRequestItem {"selector":"*://*.estadao.com.br/paywall/*","action":"cancel"}
// @webRequestItem {"selector":"*://www.folhadelondrina.com.br/login.php*","action":"cancel"}
Expand All @@ -99,6 +96,7 @@
// @webRequestItem {"selector":"*://prisa-el-pais-brasil-prod.cdn.arcpublishing.com/arc/subs/p.js","action":"cancel"}
// @webRequestItem {"selector":"*://prisa-el-pais-prod.cdn.arcpublishing.com/arc/subs/p.js","action":"cancel"}
// @webRequestItem {"selector":"*://brasil.elpais.com/pf/resources/dist/js/article.js*","action":"cancel"}
// @webRequestItem {"selector":"*://gauchazh.clicrbs.com.br/static/signwall.*.min.js","action":"cancel"}
// @run-at document-start
// @noframes
// ==/UserScript==
Expand All @@ -112,9 +110,6 @@ if (/gauchazh\.clicrbs\.com\.br/.test(document.location.host)) {
url: jsurl,
onload: function(response) {
var injectme = response.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");', '');
Expand All @@ -127,18 +122,19 @@ if (/gauchazh\.clicrbs\.com\.br/.test(document.location.host)) {
});
}

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 = '<p>Por favor aperte Ctrl-F5 para carregar o restante da notícia!</p>';
}
setTimeout(function(){ check(); }, 1000);
setTimeout(function(){ check(); }, 5000);
}
check();
};
Expand Down

0 comments on commit b5642b2

Please sign in to comment.