├── .gitignore ├── icon.png ├── Makefile ├── package.json ├── eslint.config.mjs ├── README.md ├── .travis.yml ├── LICENSE.txt └── src └── burlesco.user.js /.gitignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | .DS_Store 3 | node_modules/ 4 | -------------------------------------------------------------------------------- /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/burlesco/userscript/HEAD/icon.png -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | SHELL:=/bin/bash 2 | DIST_DIR=dist 3 | .PHONY: all clean lint build 4 | all: clean lint build 5 | clean: 6 | rm -rf "$(DIST_DIR)" 7 | lint: 8 | npx eslint src/burlesco.user.js 9 | build: clean 10 | mkdir -p "$(DIST_DIR)" 11 | python3 build.py src/burlesco.user.js > "$(DIST_DIR)/burlesco.user.js" 12 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "module", 3 | "eslintConfig": { 4 | "env": { 5 | "browser": true, 6 | "webextension": true, 7 | "greasemonkey": true 8 | } 9 | }, 10 | "dependencies": { 11 | "@stylistic/eslint-plugin-js": "^2.1.0", 12 | "eslint": "^9.4.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import js from '@eslint/js'; 2 | import stylisticJs from '@stylistic/eslint-plugin-js'; 3 | 4 | export default { 5 | ...js.configs.recommended, 6 | 'languageOptions': { 7 | 'parserOptions': { 8 | 'ecmaVersion': 2020 9 | } 10 | }, 11 | 'plugins': { 12 | '@stylistic/js': stylisticJs 13 | }, 14 | 'rules': { 15 | 'indent': ['error', 2], 16 | 'linebreak-style': ['error', 'unix'], 17 | 'quotes': ['error', 'single'], 18 | 'semi': ['error', 'always'] 19 | } 20 | }; 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | O script `build.py` é um pré-processador de userscript. 2 | 3 | @webRequestItem 4 | =============== 5 | O Tampermonkey [não suporta múltiplas entradas para a tag @webRequest](https://github.com/Tampermonkey/tampermonkey/issues/397), então teríamos que escrever todos os filtros de URL em uma linha. Porém isso prejudicaria os diffs e deixaria o código pouco legível. 6 | 7 | Com a tag `@webRequestItem`, podemos especificar um elemento do array de `@webRequest` separadamente. O pré-processador `build.py` então converte essas entradas em um único `@webRequest`. 8 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | dist: trusty 3 | node_js: 4 | - "11" 5 | install: 6 | - npm install -g eslint 7 | script: 8 | - make lint 9 | before_deploy: 10 | - make build 11 | deploy: 12 | - provider: releases 13 | skip_cleanup: true 14 | api_key: 15 | secure: KI+ygLjvGfAJaZsPw20gB35iDH+q1AAIK5OJ1khIc52GSW6P+d6ORU/nTRdysFjmaB4cfDpkjO1rCdwa6Ge4eOCXMY9E3/mS7ZxRY94PT9hELVoNnqiEK/Z4UnrNdrJgBTt7By7R3o5O4hrihGHSbfAqHmbKSg53Xs5BaEW+fOVr36vQYsx3WhK1RhfCh369WWnR0cHqGsaYSfwwkeSLBU6nzmuzivsUwOjxVoX21f8U25c2/rDJzcQ7yjc5STBjYwrnm4Kj/vJyleMP8J78k0Bt3k05O4NOBHwuGSSyC7iSX4SAisjO+dA8a6LfOgKFZXPfjfqI+xOKMdY96Ytlj3hPNe/y1vgWR+FDSV59sdV5XNzlm9MnXKlcTZGzs1bPl1l0oLil6B5cxGnnG3IxsAlEW2QPL8BXzkc+BGqWkoUa1DpPpA0i6H++bHSvFzHtwyS5JzxME8kOI/Go6Ly9ODA9+7F4tgfOQuhtsYbxZG/B6rIhAfiAcqU3MmwaRYcvX64+BosJ0e/gwDF6H5cd6LtTKz+BA3E/9vrtRyBqaxNVJJOpOBMy+GqpORO6i3wO3h1KDvpqqBo8BrXnbotJA6n9DEzKp7GXSzik5lKDLn1iK5sAHzgK2BZf23vsS/0odHboAHvMsV64jLxmQZvMtDgKqe0dzkbrIKdWROIpo6c= 16 | file: 17 | - dist/burlesco.user.js 18 | on: 19 | branch: master 20 | tags: true 21 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016-present, rodorgas 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 9 | of the Software, and to permit persons to whom the Software is furnished to do 10 | so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/burlesco.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Burlesco 3 | // @namespace https://burles.co/ 4 | // @version 13.1 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 | // @webRequestItem {"selector":"*://correio-static.cworks.cloud/vendor/bower_components/paywall.js/paywall.js*","action":"cancel"} 76 | // @webRequestItem {"selector":{"include":"*://paywall.folha.uol.com.br/*","exclude":"*://paywall.folha.uol.com.br/status.php"} ,"action":"cancel"} 77 | // @webRequestItem {"selector":"*://static.folha.uol.com.br/paywall/*","action":"cancel"} 78 | // @webRequestItem {"selector":"*://ogjs.infoglobo.com.br/*/js/controla-acesso-aux.js","action":"cancel"} 79 | // @webRequestItem {"selector":"*://static.infoglobo.com.br/paywall/register-piano/*/scripts/nova-tela-register.js","action":"cancel"} 80 | // @webRequestItem {"selector":"*://www.netdeal.com.br/*","action":"cancel"} 81 | // @webRequestItem {"selector":"*://correio.rac.com.br/includes/js/novo_cp/fivewall.js*","action":"cancel"} 82 | // @webRequestItem {"selector":"*://dashboard.tinypass.com/xbuilder/experience/load*","action":"cancel"} 83 | // @webRequestItem {"selector":"*://*.fivewall.com.br/*","action":"cancel"} 84 | // @webRequestItem {"selector":"*://*.nytimes.com/js/mtr.js","action":"cancel"} 85 | // @webRequestItem {"selector":"*://*.washingtonpost.com/wp-stat/pwapi/*","action":"cancel"} 86 | // @webRequestItem {"selector":"*://cdn.tinypass.com/api/tinypass.min.js","action":"cancel"} 87 | // @webRequestItem {"selector":"*://api.tinypass.com/*","action":"cancel"} 88 | // @webRequestItem {"selector":"*://tm.jsuol.com.br/modules/content-gate.js","action":"cancel"} 89 | // @webRequestItem {"selector":"https://paywall.nsctotal.com.br/behaviors","action":"cancel"} 90 | // @webRequestItem {"selector":"*://www.folhadelondrina.com.br/login.php*","action":"cancel"} 91 | // @webRequestItem {"selector":"https://www.eltiempo.com/js/desktopArticle.js*","action":"cancel"} 92 | // @webRequestItem {"selector":"*://*.haaretz.co.il/*/inter.js","action":"cancel"} 93 | // @webRequestItem {"selector":"*://*.themarker.com/*/inter.js","action":"cancel"} 94 | // @webRequestItem {"selector":"*://*.diarinho.com.br/wp-admin/admin-ajax.php","action":"cancel"} 95 | // @webRequestItem {"selector":"*://diarinho.com.br/wp-admin/admin-ajax.php","action":"cancel"} 96 | // @webRequestItem {"selector":"*://static.infoglobo.com.br/paywall/js/tiny.js","action":"cancel"} 97 | // @webRequestItem {"selector":"*://*.abril.com.br/wp-content/plugins/abril-plugins/abril-paywall/js/paywall.js*","action":"cancel"} 98 | // @webRequestItem {"selector":"*://exame.com/wp-content/themes/exame-new/js/pywll.js","action":"cancel"} 99 | // @webRequestItem {"selector":"*://prisa-el-pais-brasil-prod.cdn.arcpublishing.com/arc/subs/p.js","action":"cancel"} 100 | // @webRequestItem {"selector":"*://prisa-el-pais-prod.cdn.arcpublishing.com/arc/subs/p.js","action":"cancel"} 101 | // @webRequestItem {"selector":"*://brasil.elpais.com/pf/resources/dist/js/article.js*","action":"cancel"} 102 | // @webRequestItem {"selector":"*://gauchazh.clicrbs.com.br/static/signwall.*.min.js","action":"cancel"} 103 | // @webRequestItem {"selector":"*://*.zephr.com/zephr-browser/*/zephr-browser.umd.js","action":"cancel"} 104 | // @run-at document-start 105 | // @noframes 106 | // ==/UserScript== 107 | 108 | // run_at: document_start 109 | if (/jota\.info/.test(document.location.host)) { 110 | var page_url = window.location.href; 111 | if (page_url.search('paywall') >= 0) { // Só ativa em urls com paywall 112 | var new_page_url = window.location.href.replace('www.jota.info/paywall?redirect_to=//', ''); 113 | GM_xmlhttpRequest({ 114 | method: 'GET', 115 | url: new_page_url, 116 | headers: { 117 | 'User-Agent': 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)' 118 | }, 119 | anonymous: true, 120 | onload: function(response) { 121 | var parser = new DOMParser(); 122 | var newDocument = parser.parseFromString(response.responseText,'text/html'); 123 | newDocument.getElementsByClassName('jota-paywall')[0].remove(); // Já remove o anúncio do paywall antes de inserir 124 | if (newDocument) { 125 | document.open(); 126 | history.pushState({urlPath: new_page_url}, '', new_page_url); // Atualiza a url sem fazer um novo refresh 127 | document.write(newDocument.getElementsByTagName('html')[0].innerHTML); 128 | document.close(); 129 | } 130 | } 131 | }); 132 | } 133 | } 134 | 135 | else if (/crusoe\.com\.br/.test(document.location.host)) { 136 | document.cookie = 'crs_subscriber=1'; 137 | } 138 | 139 | else if (/correiodopovo\.com\.br/.test(document.location.host)) { 140 | const cleanPaywall = () => { 141 | const div = document.querySelector('[id^="pwm"] > div'); 142 | const iframe = document.querySelector('[id^="pwm"] > iframe'); 143 | document.querySelector('body').style.overflow = 'initial'; 144 | iframe?.parentNode.removeChild(iframe); 145 | div?.parentNode.removeChild(div); 146 | }; 147 | setTimeout(cleanPaywall, 4000); 148 | cleanPaywall(); 149 | } 150 | 151 | // run_at: document_idle 152 | document.addEventListener('DOMContentLoaded', function() { 153 | var code = null; 154 | 155 | if (/gauchazh\.clicrbs\.com\.br/.test(document.location.host)) { 156 | code = ` 157 | (async () => { 158 | const data = JSON.parse(decodeURI(window.__ISOMORPHIC_DATA__)).state.apollo.ROOT_QUERY 159 | const key = Object.keys(data).filter(key => key.includes('article'))[0] 160 | 161 | const parts = data[key].article_body_components 162 | .map(item => \`