Burlesco

Leia notícias sem ser assinante, burle o paywall

  1. // ==UserScript==
  2. // @name Burlesco
  3. // @namespace https://burles.co/
  4. // @version 14.0
  5. // @description Leia notícias sem ser assinante, burle o paywall
  6. // @author rodorgas & AugustoResende
  7. // @supportURL https://burles.co
  8. // @icon https://raw.githubusercontent.com/burlesco/site/master/logo_semfundo.png
  9. // Atenção: Caso algum site não funcione logo após a instalação, limpe o cache do navegador.
  10. // @grant GM_webRequest
  11. // @grant GM_xmlhttpRequest
  12. // @connect gauchazh.clicrbs.com.br
  13. // @connect gauchazh.clicrbs.com.br.
  14. // @connect static.infoglobo.com.br
  15. // @connect cdn.tinypass.com
  16. // @connect observador.pt
  17. // @connect brasil.elpais.com
  18. // @match *://www.bloomberg.com/*
  19. // @match *://correio.rac.com.br/*
  20. // @match *://*.nsctotal.com.br/*
  21. // @match *://www.economist.com/*
  22. // @match *://*.estadao.com.br/*
  23. // @match *://foreignpolicy.com/*
  24. // @match *://*.fivewall.com.br/*
  25. // @match *://*.folha.uol.com.br/*
  26. // @match *://*.folha.com.br/*
  27. // @match *://gauchazh.clicrbs.com.br/*
  28. // @match *://*.zh.clicrbs.com.br/*
  29. // @match *://api.clicrbs.com.br/*
  30. // @match *://*.gazetadopovo.com.br/*
  31. // @match *://ogjs.infoglobo.com.br/*
  32. // @match *://*.jota.info/*
  33. // @match *://www.jornalnh.com.br/*
  34. // @match *://www.netdeal.com.br/*
  35. // @match *://*.nytimes.com/*
  36. // @match *://*.nyt.com/*
  37. // @match *://*.oglobo.globo.com/*
  38. // @match *://api.tinypass.com/*
  39. // @match *://cdn.tinypass.com/*
  40. // @match *://dashboard.tinypass.com/*
  41. // @match *://*.washingtonpost.com/*
  42. // @match *://*.exame.com/*
  43. // @match *://www.eltiempo.com/*
  44. // @match *://super.abril.com.br/*
  45. // @match *://veja.abril.com.br/*
  46. // @match *://quatrorodas.abril.com.br/*
  47. // @match *://*.uol.com.br/*
  48. // @match *://www.uol/*
  49. // @match *://*.wsj.com/*
  50. // @match *://*.ft.com/*
  51. // @match *://*.gramophone.co.uk/*
  52. // @match *://*.folhadelondrina.com.br/*
  53. // @match *://*.wired.com/*
  54. // @match *://www.jornalvs.com.br/*
  55. // @match *://*.br18.com.br/*
  56. // @match *://*.diariopopular.com.br/*
  57. // @match *://*.haaretz.com/*
  58. // @match *://*.haaretz.co.il/*
  59. // @match *://*.diarinho.com.br/*
  60. // @match *://*.diariodaregiao.com.br/*
  61. // @match *://*.correio24horas.com.br/*
  62. // @match *://*.dgabc.com.br/*
  63. // @match *://crusoe.com.br/*
  64. // @match *://*.em.com.br/*
  65. // @match *://*.forbes.pl/*
  66. // @match *://*.forbes.com/*
  67. // @match *://*.newsweek.pl/*
  68. // @match *://*.seudinheiro.com/*
  69. // @match *://*.diariodecanoas.com.br/*
  70. // @match *://*.observador.pt/*
  71. // @match *://*.elpais.com/*
  72. // @match *://*.correiodopovo.com.br/*
  73. // @match *://*.technologyreview.com/*
  74. // @match *://*.revistagalileu.globo.com/*
  75. // @webRequest [{"selector":"*://correio-static.cworks.cloud/vendor/bower_components/paywall.js/paywall.js*","action":"cancel"},{"selector":{"include":"*://paywall.folha.uol.com.br/*","exclude":"*://paywall.folha.uol.com.br/status.php"} ,"action":"cancel"},{"selector":"*://static.folha.uol.com.br/paywall/*","action":"cancel"},{"selector":"*://ogjs.infoglobo.com.br/*/js/controla-acesso-aux.js","action":"cancel"},{"selector":"*://static.infoglobo.com.br/paywall/register-piano/*/scripts/nova-tela-register.js","action":"cancel"},{"selector":"*://www.netdeal.com.br/*","action":"cancel"},{"selector":"*://correio.rac.com.br/includes/js/novo_cp/fivewall.js*","action":"cancel"},{"selector":"*://dashboard.tinypass.com/xbuilder/experience/load*","action":"cancel"},{"selector":"*://*.fivewall.com.br/*","action":"cancel"},{"selector":"*://*.nytimes.com/js/mtr.js","action":"cancel"},{"selector":"*://*.washingtonpost.com/wp-stat/pwapi/*","action":"cancel"},{"selector":"*://cdn.tinypass.com/api/tinypass.min.js","action":"cancel"},{"selector":"*://api.tinypass.com/*","action":"cancel"},{"selector":"*://tm.jsuol.com.br/modules/content-gate.js","action":"cancel"},{"selector":"https://paywall.nsctotal.com.br/behaviors","action":"cancel"},{"selector":"*://www.folhadelondrina.com.br/login.php*","action":"cancel"},{"selector":"https://www.eltiempo.com/js/desktopArticle.js*","action":"cancel"},{"selector":"*://*.haaretz.co.il/*/inter.js","action":"cancel"},{"selector":"*://*.themarker.com/*/inter.js","action":"cancel"},{"selector":"*://*.diarinho.com.br/wp-admin/admin-ajax.php","action":"cancel"},{"selector":"*://diarinho.com.br/wp-admin/admin-ajax.php","action":"cancel"},{"selector":"*://static.infoglobo.com.br/paywall/js/tiny.js","action":"cancel"},{"selector":"*://*.abril.com.br/wp-content/plugins/abril-plugins/abril-paywall/js/paywall.js*","action":"cancel"},{"selector":"*://exame.com/wp-content/themes/exame-new/js/pywll.js","action":"cancel"},{"selector":"*://prisa-el-pais-brasil-prod.cdn.arcpublishing.com/arc/subs/p.js","action":"cancel"},{"selector":"*://prisa-el-pais-prod.cdn.arcpublishing.com/arc/subs/p.js","action":"cancel"},{"selector":"*://brasil.elpais.com/pf/resources/dist/js/article.js*","action":"cancel"},{"selector":"*://gauchazh.clicrbs.com.br/static/signwall.*.min.js","action":"cancel"},{"selector":"*://*.zephr.com/zephr-browser/*/zephr-browser.umd.js","action":"cancel"}]
  76. // @run-at document-start
  77. // @noframes
  78. // ==/UserScript==
  79.  
  80. // run_at: document_start
  81. if (/jota\.info/.test(document.location.host)) {
  82. var page_url = window.location.href;
  83. if (page_url.search('paywall') >= 0) { // Só ativa em urls com paywall
  84. var new_page_url = window.location.href.replace('www.jota.info/paywall?redirect_to=//', '');
  85. GM_xmlhttpRequest({
  86. method: 'GET',
  87. url: new_page_url,
  88. headers: {
  89. 'User-Agent': 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)'
  90. },
  91. anonymous: true,
  92. onload: function(response) {
  93. var parser = new DOMParser();
  94. var newDocument = parser.parseFromString(response.responseText,'text/html');
  95. newDocument.getElementsByClassName('jota-paywall')[0].remove(); // Já remove o anúncio do paywall antes de inserir
  96. if (newDocument) {
  97. document.open();
  98. history.pushState({urlPath: new_page_url}, '', new_page_url); // Atualiza a url sem fazer um novo refresh
  99. document.write(newDocument.getElementsByTagName('html')[0].innerHTML);
  100. document.close();
  101. }
  102. }
  103. });
  104. }
  105. }
  106.  
  107. else if (/crusoe\.com\.br/.test(document.location.host)) {
  108. document.cookie = 'crs_subscriber=1';
  109. }
  110.  
  111. else if (/correiodopovo\.com\.br/.test(document.location.host)) {
  112. const cleanPaywall = () => {
  113. const div = document.querySelector('[id^="pwm"] > div');
  114. const iframe = document.querySelector('[id^="pwm"] > iframe');
  115. document.querySelector('body').style.overflow = 'initial';
  116. iframe?.parentNode.removeChild(iframe);
  117. div?.parentNode.removeChild(div);
  118. };
  119. setTimeout(cleanPaywall, 4000);
  120. cleanPaywall();
  121. }
  122.  
  123. // run_at: document_idle
  124. document.addEventListener('DOMContentLoaded', function() {
  125. var code = null;
  126.  
  127. if (/gauchazh\.clicrbs\.com\.br/.test(document.location.host)) {
  128. code = `
  129. (async () => {
  130. const data = JSON.parse(decodeURI(window.__ISOMORPHIC_DATA__)).state.apollo.ROOT_QUERY
  131. const key = Object.keys(data).filter(key => key.includes('article'))[0]
  132.  
  133. const parts = data[key].article_body_components
  134. .map(item => \`<div class="article-paragraph">\${item.html || item.data.embed}</div>\`)
  135. const content = parts.reduce((acc, curr) => acc + curr)
  136.  
  137. while (true) {
  138. const article = document.querySelector('.article-paragraph')
  139. if (article === null) {
  140. await new Promise(r => setTimeout(r, 1000));
  141. continue
  142. }
  143.  
  144. article.insertAdjacentHTML('afterend', content)
  145. document.querySelectorAll('.article-paragraph').forEach(item => {
  146. item.style.opacity = '1';
  147. })
  148. document.querySelectorAll('a').forEach(item => {
  149. item.addEventListener('click', (e) => {
  150. e.stopImmediatePropagation()
  151. return false;
  152. })
  153. })
  154.  
  155. var style = document.createElement('style');
  156. style.textContent = '.paid-content-template::before { display: none; }';
  157. (document.head||document.documentElement).appendChild(script);
  158.  
  159. break;
  160. }
  161. })()
  162. `;
  163. }
  164.  
  165. if (/www\.economist\.com/.test(document.location.host)) {
  166. code = 'document.cookie = "ec_limit=allow";';
  167. code = `
  168. var artBodyContainer = document.querySelector("article.article");
  169. var artBody = artBodyContainer.innerHTML;
  170. checkPaywall();
  171. function checkPaywall () {
  172. let paywallBox = document.querySelector(".layout-article-regwall");
  173. if (paywallBox) {
  174. artBodyContainer.innerHTML = artBody;
  175. } else {
  176. setTimeout(checkPaywall, 100);
  177. }
  178. };
  179. `;
  180. }
  181.  
  182. else if (/ft\.com/.test(document.location.host)
  183. && document.querySelector('.barrier-banner')) {
  184.  
  185. eraseAllCookies();
  186.  
  187. document.cookie = '';
  188. localStorage.clear();
  189. sessionStorage.clear();
  190. indexedDB.deleteDatabase('next-flags');
  191. indexedDB.deleteDatabase('next:ads');
  192.  
  193. document.querySelector('.o-cookie-message').remove();
  194.  
  195. GM_xmlhttpRequest({
  196. method: 'GET',
  197. url: window.location.href,
  198. headers: {
  199. 'Referer': 'https://www.google.com.br/'
  200. },
  201. anonymous: true,
  202. onload: function(response) {
  203. var parser = new DOMParser();
  204. var newDocument = parser.parseFromString(response.responseText,'text/html');
  205. if (newDocument.getElementsByClassName('article__content')[0]) {
  206. document.open();
  207. document.write(newDocument.getElementsByTagName('html')[0].innerHTML);
  208. document.close();
  209. }
  210. }
  211. });
  212. }
  213.  
  214. else if (/foreignpolicy\.com/.test(document.location.host)) {
  215. code = `
  216. document.getElementById("paywall_bg").remove();
  217. document.body.classList.remove("overlay-no-scroll");
  218. document.body.style.overflow = "visible";
  219. document.documentElement.classList.remove("overlay-no-scroll");
  220. `;
  221. }
  222.  
  223. else if (/folha\.uol\.com\.br/.test(document.location.host)) {
  224. code = `
  225. omtrClickUOL = function(){};function showText() {
  226. $("#bt-read-more-content").next().show();
  227. $("#bt-read-more-content").next().show().prev().remove();
  228. }
  229. setTimeout(showText, 100);
  230. `;
  231. }
  232.  
  233. else if (/abril\.com\.br/.test(document.location.host))
  234. code = `
  235. window.setTimeout(function() {
  236. document.querySelector('body').classList.remove('disabledByPaywall')
  237. document.querySelector('.piano-offer-overlay').remove()
  238. document.querySelector('#piano_offer').remove()
  239. }, 10000)
  240. `;
  241.  
  242.  
  243. else if(/correio24horas\.com\.br/.test(document.location.host))
  244. // remover tudo relacionado ao paywall e remover limite de altura no div do conteúdo da matéria
  245. // verificar se a altura não buga com a mudança de largura da página (layout responsivo, né)
  246. code=`
  247. jQuery('[class^=paywall]').remove();
  248. jQuery('[class^=blocked]').removeClass();
  249. jQuery('[id^=paywall]').removeClass('hide').removeClass('is-active');
  250. jQuery('.noticias-single__content__text').attr('style', 'height:auto;');
  251. jQuery('[id^=paywall]').remove();
  252. setInterval(function() { jQuery('[itemprop^=articleBody]').css('height', '100%'); console.log('Burlesco: forçando altura...'); }, 1000);
  253.  
  254. `;
  255.  
  256. else if (/nytimes\.com/.test(document.location.host))
  257. eraseAllCookies();
  258.  
  259. else if (/wsj\.com/.test(document.location.host)
  260. && document.querySelector('.wsj-snippet-login')) {
  261.  
  262. eraseAllCookies();
  263.  
  264. document.cookie = '';
  265. localStorage.clear();
  266. sessionStorage.clear();
  267.  
  268. GM_xmlhttpRequest({
  269. method: 'GET',
  270. url: window.location.href,
  271. headers: {
  272. 'Referer': 'https://www.facebook.com/'
  273. },
  274. anonymous: true,
  275. onload: function(response) {
  276. var parser = new DOMParser();
  277. var newDocument = parser.parseFromString(response.responseText,'text/html');
  278. if (newDocument.querySelector('article')) {
  279. document.body = newDocument.body;
  280. }
  281. }
  282. });
  283. }
  284.  
  285. else if (/bloomberg\.com/.test(document.location.host)) {
  286. localStorage.clear();
  287. sessionStorage.clear();
  288. }
  289.  
  290. else if (/diariodaregiao\.com\.br/.test(document.location.host))
  291. {
  292. document.getElementsByClassName('noticia-texto')[0].style.display = 'block';
  293. document.querySelector('.conteudo > .row').style.display = 'none';
  294. }
  295.  
  296. else if (/diariopopular\.com\.br/.test(document.location.host)) {
  297. eraseAllCookies();
  298. }
  299.  
  300. else if (/wired\.com/.test(document.location.host)) {
  301. code = `
  302. window.onload = function() {
  303. style = document.createElement('style');
  304. style.type = 'text/css';
  305. css='.paywall-container-component {display: none !important}';
  306. style.appendChild(document.createTextNode(css));
  307. document.head.appendChild(style);
  308. }
  309. document.cookie = "";
  310. localStorage.clear();
  311. sessionStorage.clear();
  312. `;
  313. eraseAllCookies();
  314. }
  315.  
  316. else if (/haaretz\.com/.test(document.location.host) ||
  317. (/haaretz\.co\.il/.test(document.location.host))) {
  318.  
  319. GM_xmlhttpRequest({
  320. method: 'GET',
  321. url: window.location.href,
  322. headers: {
  323. 'User-Agent': 'Googlebot/2.1 (+http://www.googlebot.com/bot.html)'
  324. },
  325. anonymous: true,
  326. onload: function(response) {
  327. var parser = new DOMParser();
  328. var newDocument = parser.parseFromString(response.responseText,'text/html');
  329. if (newDocument) {
  330. document.open();
  331. document.write(newDocument.getElementsByTagName('html')[0].innerHTML);
  332. document.close();
  333. }
  334. }
  335. });
  336. }
  337.  
  338. else if (/dgabc\.com\.br/.test(document.location.host)) {
  339. code = `
  340. var email = 'colaborador@dgabc.com.br';
  341. var senha = '';
  342. localStorage.emailNoticiaExclusiva = email;
  343. $('.NoticiaExclusivaNaoLogado').hide();
  344. $('.NoticiaExclusivaLogadoSemPermissao').hide();
  345. $('.linhaSuperBanner').show();
  346. $('.footer').show();
  347. $('.NoticiaExclusivaLogado').show();
  348. `;
  349. }
  350.  
  351. else if (/em\.com\.br/.test(document.location.host)) {
  352. window.id_acesso_noticia = 0;
  353.  
  354. let style = document.createElement('style');
  355. style.type = 'text/css';
  356.  
  357. let css=`
  358. .news-blocked {
  359. display: none !important
  360. }
  361. .news-blocked-no-scroll {
  362. overflow: auto !important;
  363. width: auto !important;
  364. position: unset !important;
  365. }
  366.  
  367. div[itemprop="articleBody"] {
  368. height: auto !important;
  369. }
  370. `;
  371.  
  372. style.appendChild(document.createTextNode(css));
  373. document.head.appendChild(style);
  374. }
  375.  
  376. else if (/newsweek\.pl|forbes\.pl/.test(document.location.host)) {
  377. let contentPremium = document.querySelector('.contentPremium');
  378. if (contentPremium) {
  379. contentPremium.classList.remove('contentPremium');
  380. }
  381. }
  382. else if (/forbes\.com/.test(document.location.host)) {
  383. setInterval(() => {
  384. document.querySelector('.zephr-modal-open')?.classList.remove('zephr-modal-open');
  385. document.querySelector('.zephr-backdrop')?.remove();
  386. document.querySelector('.zephr-generic-modal')?.remove();
  387. }, 2000);
  388. }
  389. else if (/seudinheiro\.com/.test(document.location.host)) {
  390. document.querySelector('#premium-paywall').remove();
  391. document.body.style.overflow = '';
  392. }
  393.  
  394. else if (/observador\.pt/.test(document.location.host)) {
  395. setInterval(() => {
  396. document.querySelector('.piano-article-blocker').remove();
  397. document.querySelector('.article-body-wrapper').style.maxHeight = 'inherit';
  398. document.querySelector('.premium-article').classList.add('article-shown');
  399. }, 5000);
  400. }
  401. else if (/technologyreview\.com/.test(document.location.host)) {
  402. document.querySelector('#template-container').remove();
  403. localStorage.clear();
  404. eraseCookie('xbc');
  405. eraseCookie('_pcid');
  406. eraseCookie('_pcus');
  407. eraseCookie('__tbc');
  408. eraseCookie('__pvi');
  409. eraseCookie('_pctx');
  410. }
  411.  
  412. else if (/revistagalileu\.globo\.com/.test(document.location.host)) {
  413. const cleanGalileu = () => {
  414. const div = document.querySelector('#detecta-adblock');
  415. document.querySelector('body').style.overflow = 'initial';
  416. div?.parentNode.removeChild(div);
  417. };
  418. cleanGalileu();
  419. setTimeout(cleanGalileu, 4000);
  420. }
  421.  
  422. if (code !== null) {
  423. var script = document.createElement('script');
  424. script.textContent = code;
  425. (document.head||document.documentElement).appendChild(script);
  426. script.parentNode.removeChild(script);
  427. }
  428. });
  429.  
  430. function eraseAllCookies() {
  431. var cookieList = document.cookie.split (/;\s*/);
  432. for (var J = cookieList.length - 1; J >= 0; --J) {
  433. var cookieName = cookieList[J].replace (/\s*(\w+)=.+$/, '$1');
  434. eraseCookie (cookieName);
  435. }
  436. }
  437.  
  438. function eraseCookie (cookieName) {
  439. // https://stackoverflow.com/a/28081337/1840019
  440. //--- ONE-TIME INITS:
  441. //--- Set possible domains. Omits some rare edge cases.?.
  442. var domain = document.domain;
  443. var domain2 = document.domain.replace (/^www\./, '');
  444. var domain3 = document.domain.replace (/^(\w+\.)+?(\w+\.\w+)$/, '$2');
  445.  
  446. //--- Get possible paths for the current page:
  447. var pathNodes = location.pathname.split ('/').map ( function (pathWord) {
  448. return '/' + pathWord;
  449. } );
  450. var cookPaths = [''].concat (pathNodes.map ( function (pathNode) {
  451. if (this.pathStr) {
  452. this.pathStr += pathNode;
  453. }
  454. else {
  455. this.pathStr = '; path=';
  456. return (this.pathStr + pathNode);
  457. }
  458. return (this.pathStr);
  459. } ) );
  460.  
  461. // eslint-disable-next-line no-func-assign
  462. ( eraseCookie = function (cookieName) {
  463. //--- For each path, attempt to delete the cookie.
  464. cookPaths.forEach ( function (pathStr) {
  465. //--- To delete a cookie, set its expiration date to a past value.
  466. var diagStr = cookieName + '=' + pathStr + '; expires=Thu, 01-Jan-1970 00:00:01 GMT;';
  467. document.cookie = diagStr;
  468.  
  469. document.cookie = cookieName + '=' + pathStr + '; domain=' + domain + '; expires=Thu, 01-Jan-1970 00:00:01 GMT;';
  470. document.cookie = cookieName + '=' + pathStr + '; domain=' + domain2 + '; expires=Thu, 01-Jan-1970 00:00:01 GMT;';
  471. document.cookie = cookieName + '=' + pathStr + '; domain=' + domain3 + '; expires=Thu, 01-Jan-1970 00:00:01 GMT;';
  472. } );
  473. } ) (cookieName);
  474. }
  475.