├── .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 => \`
\${item.html || item.data.embed}
\`) 163 | const content = parts.reduce((acc, curr) => acc + curr) 164 | 165 | while (true) { 166 | const article = document.querySelector('.article-paragraph') 167 | if (article === null) { 168 | await new Promise(r => setTimeout(r, 1000)); 169 | continue 170 | } 171 | 172 | article.insertAdjacentHTML('afterend', content) 173 | document.querySelectorAll('.article-paragraph').forEach(item => { 174 | item.style.opacity = '1'; 175 | }) 176 | document.querySelectorAll('a').forEach(item => { 177 | item.addEventListener('click', (e) => { 178 | e.stopImmediatePropagation() 179 | return false; 180 | }) 181 | }) 182 | 183 | var style = document.createElement('style'); 184 | style.textContent = '.paid-content-template::before { display: none; }'; 185 | (document.head||document.documentElement).appendChild(script); 186 | 187 | break; 188 | } 189 | })() 190 | `; 191 | } 192 | 193 | if (/www\.economist\.com/.test(document.location.host)) { 194 | code = 'document.cookie = "ec_limit=allow";'; 195 | code = ` 196 | var artBodyContainer = document.querySelector("article.article"); 197 | var artBody = artBodyContainer.innerHTML; 198 | checkPaywall(); 199 | function checkPaywall () { 200 | let paywallBox = document.querySelector(".layout-article-regwall"); 201 | if (paywallBox) { 202 | artBodyContainer.innerHTML = artBody; 203 | } else { 204 | setTimeout(checkPaywall, 100); 205 | } 206 | }; 207 | `; 208 | } 209 | 210 | else if (/ft\.com/.test(document.location.host) 211 | && document.querySelector('.barrier-banner')) { 212 | 213 | eraseAllCookies(); 214 | 215 | document.cookie = ''; 216 | localStorage.clear(); 217 | sessionStorage.clear(); 218 | indexedDB.deleteDatabase('next-flags'); 219 | indexedDB.deleteDatabase('next:ads'); 220 | 221 | document.querySelector('.o-cookie-message').remove(); 222 | 223 | GM_xmlhttpRequest({ 224 | method: 'GET', 225 | url: window.location.href, 226 | headers: { 227 | 'Referer': 'https://www.google.com.br/' 228 | }, 229 | anonymous: true, 230 | onload: function(response) { 231 | var parser = new DOMParser(); 232 | var newDocument = parser.parseFromString(response.responseText,'text/html'); 233 | if (newDocument.getElementsByClassName('article__content')[0]) { 234 | document.open(); 235 | document.write(newDocument.getElementsByTagName('html')[0].innerHTML); 236 | document.close(); 237 | } 238 | } 239 | }); 240 | } 241 | 242 | else if (/foreignpolicy\.com/.test(document.location.host)) { 243 | code = ` 244 | document.getElementById("paywall_bg").remove(); 245 | document.body.classList.remove("overlay-no-scroll"); 246 | document.body.style.overflow = "visible"; 247 | document.documentElement.classList.remove("overlay-no-scroll"); 248 | `; 249 | } 250 | 251 | else if (/folha\.uol\.com\.br/.test(document.location.host)) { 252 | code = ` 253 | window.addEventListener('DOMContentLoaded', () => { 254 | const originalFetch = window.fetch; 255 | window.fetch = function(resource, init) { 256 | // Verifica se a URL contém o endpoint do paywall JSON 257 | if (typeof resource === 'string' && resource.includes('paywall.folha.uol.com.br/wall.json')) { 258 | console.log('[FolhaPaywall] Interceptando paywall.json'); 259 | // Retorna uma resposta fake que zera o paywall 260 | const fakeResponse = new Response(JSON.stringify({ paywall: "off", status: "ok" }), { 261 | status: 200, 262 | headers: { 'Content-Type': 'application/json' } 263 | }); 264 | return Promise.resolve(fakeResponse); 265 | } 266 | return originalFetch.apply(this, arguments); 267 | }; 268 | }); 269 | `; 270 | } 271 | 272 | else if (/estadao\.com\.br/.test(document.location.host)) { 273 | code = ` 274 | window.addEventListener('DOMContentLoaded', () => { 275 | Object.defineProperty(window, 'pwz', { 276 | configurable: true, 277 | writable: false, 278 | value: function () { 279 | console.log('paywall bloqueado'); 280 | } 281 | }); 282 | }); 283 | `; 284 | } 285 | 286 | else if (/abril\.com\.br/.test(document.location.host)) 287 | code = ` 288 | window.setTimeout(function() { 289 | document.querySelector('body').classList.remove('disabledByPaywall') 290 | document.querySelector('.piano-offer-overlay').remove() 291 | document.querySelector('#piano_offer').remove() 292 | }, 10000) 293 | `; 294 | 295 | 296 | else if(/correio24horas\.com\.br/.test(document.location.host)) 297 | // remover tudo relacionado ao paywall e remover limite de altura no div do conteúdo da matéria 298 | // verificar se a altura não buga com a mudança de largura da página (layout responsivo, né) 299 | code=` 300 | jQuery('[class^=paywall]').remove(); 301 | jQuery('[class^=blocked]').removeClass(); 302 | jQuery('[id^=paywall]').removeClass('hide').removeClass('is-active'); 303 | jQuery('.noticias-single__content__text').attr('style', 'height:auto;'); 304 | jQuery('[id^=paywall]').remove(); 305 | setInterval(function() { jQuery('[itemprop^=articleBody]').css('height', '100%'); console.log('Burlesco: forçando altura...'); }, 1000); 306 | 307 | `; 308 | 309 | else if (/nytimes\.com/.test(document.location.host)) 310 | eraseAllCookies(); 311 | 312 | else if (/wsj\.com/.test(document.location.host) 313 | && document.querySelector('.wsj-snippet-login')) { 314 | 315 | eraseAllCookies(); 316 | 317 | document.cookie = ''; 318 | localStorage.clear(); 319 | sessionStorage.clear(); 320 | 321 | GM_xmlhttpRequest({ 322 | method: 'GET', 323 | url: window.location.href, 324 | headers: { 325 | 'Referer': 'https://www.facebook.com/' 326 | }, 327 | anonymous: true, 328 | onload: function(response) { 329 | var parser = new DOMParser(); 330 | var newDocument = parser.parseFromString(response.responseText,'text/html'); 331 | if (newDocument.querySelector('article')) { 332 | document.body = newDocument.body; 333 | } 334 | } 335 | }); 336 | } 337 | 338 | else if (/bloomberg\.com/.test(document.location.host)) { 339 | localStorage.clear(); 340 | sessionStorage.clear(); 341 | } 342 | 343 | else if (/diariodaregiao\.com\.br/.test(document.location.host)) 344 | { 345 | document.getElementsByClassName('noticia-texto')[0].style.display = 'block'; 346 | document.querySelector('.conteudo > .row').style.display = 'none'; 347 | } 348 | 349 | else if (/diariopopular\.com\.br/.test(document.location.host)) { 350 | eraseAllCookies(); 351 | } 352 | 353 | else if (/wired\.com/.test(document.location.host)) { 354 | code = ` 355 | window.onload = function() { 356 | style = document.createElement('style'); 357 | style.type = 'text/css'; 358 | css='.paywall-container-component {display: none !important}'; 359 | style.appendChild(document.createTextNode(css)); 360 | document.head.appendChild(style); 361 | } 362 | document.cookie = ""; 363 | localStorage.clear(); 364 | sessionStorage.clear(); 365 | `; 366 | eraseAllCookies(); 367 | } 368 | 369 | else if (/haaretz\.com/.test(document.location.host) || 370 | (/haaretz\.co\.il/.test(document.location.host))) { 371 | 372 | GM_xmlhttpRequest({ 373 | method: 'GET', 374 | url: window.location.href, 375 | headers: { 376 | 'User-Agent': 'Googlebot/2.1 (+http://www.googlebot.com/bot.html)' 377 | }, 378 | anonymous: true, 379 | onload: function(response) { 380 | var parser = new DOMParser(); 381 | var newDocument = parser.parseFromString(response.responseText,'text/html'); 382 | if (newDocument) { 383 | document.open(); 384 | document.write(newDocument.getElementsByTagName('html')[0].innerHTML); 385 | document.close(); 386 | } 387 | } 388 | }); 389 | } 390 | 391 | else if (/dgabc\.com\.br/.test(document.location.host)) { 392 | code = ` 393 | var email = 'colaborador@dgabc.com.br'; 394 | var senha = ''; 395 | localStorage.emailNoticiaExclusiva = email; 396 | $('.NoticiaExclusivaNaoLogado').hide(); 397 | $('.NoticiaExclusivaLogadoSemPermissao').hide(); 398 | $('.linhaSuperBanner').show(); 399 | $('.footer').show(); 400 | $('.NoticiaExclusivaLogado').show(); 401 | `; 402 | } 403 | 404 | else if (/em\.com\.br/.test(document.location.host)) { 405 | window.id_acesso_noticia = 0; 406 | 407 | let style = document.createElement('style'); 408 | style.type = 'text/css'; 409 | 410 | let css=` 411 | .news-blocked { 412 | display: none !important 413 | } 414 | .news-blocked-no-scroll { 415 | overflow: auto !important; 416 | width: auto !important; 417 | position: unset !important; 418 | } 419 | 420 | div[itemprop="articleBody"] { 421 | height: auto !important; 422 | } 423 | `; 424 | 425 | style.appendChild(document.createTextNode(css)); 426 | document.head.appendChild(style); 427 | } 428 | 429 | else if (/newsweek\.pl|forbes\.pl/.test(document.location.host)) { 430 | let contentPremium = document.querySelector('.contentPremium'); 431 | if (contentPremium) { 432 | contentPremium.classList.remove('contentPremium'); 433 | } 434 | } 435 | 436 | else if (/forbes\.com/.test(document.location.host)) { 437 | setInterval(() => { 438 | document.querySelector('.zephr-modal-open')?.classList.remove('zephr-modal-open'); 439 | document.querySelector('.zephr-backdrop')?.remove(); 440 | document.querySelector('.zephr-generic-modal')?.remove(); 441 | }, 2000); 442 | } 443 | 444 | else if (/seudinheiro\.com/.test(document.location.host)) { 445 | document.querySelector('#premium-paywall').remove(); 446 | document.body.style.overflow = ''; 447 | } 448 | 449 | else if (/observador\.pt/.test(document.location.host)) { 450 | setInterval(() => { 451 | document.querySelector('.piano-article-blocker').remove(); 452 | document.querySelector('.article-body-wrapper').style.maxHeight = 'inherit'; 453 | document.querySelector('.premium-article').classList.add('article-shown'); 454 | }, 5000); 455 | } 456 | 457 | else if (/technologyreview\.com/.test(document.location.host)) { 458 | document.querySelector('#template-container').remove(); 459 | localStorage.clear(); 460 | eraseCookie('xbc'); 461 | eraseCookie('_pcid'); 462 | eraseCookie('_pcus'); 463 | eraseCookie('__tbc'); 464 | eraseCookie('__pvi'); 465 | eraseCookie('_pctx'); 466 | } 467 | 468 | else if (/revistagalileu\.globo\.com/.test(document.location.host)) { 469 | const cleanGalileu = () => { 470 | const div = document.querySelector('#detecta-adblock'); 471 | document.querySelector('body').style.overflow = 'initial'; 472 | div?.parentNode.removeChild(div); 473 | }; 474 | cleanGalileu(); 475 | setTimeout(cleanGalileu, 4000); 476 | } 477 | 478 | if (code !== null) { 479 | var script = document.createElement('script'); 480 | script.textContent = code; 481 | (document.head||document.documentElement).appendChild(script); 482 | script.parentNode.removeChild(script); 483 | } 484 | }); 485 | 486 | function eraseAllCookies() { 487 | var cookieList = document.cookie.split (/;\s*/); 488 | for (var J = cookieList.length - 1; J >= 0; --J) { 489 | var cookieName = cookieList[J].replace (/\s*(\w+)=.+$/, '$1'); 490 | eraseCookie (cookieName); 491 | } 492 | } 493 | 494 | function eraseCookie (cookieName) { 495 | // https://stackoverflow.com/a/28081337/1840019 496 | //--- ONE-TIME INITS: 497 | //--- Set possible domains. Omits some rare edge cases.?. 498 | var domain = document.domain; 499 | var domain2 = document.domain.replace (/^www\./, ''); 500 | var domain3 = document.domain.replace (/^(\w+\.)+?(\w+\.\w+)$/, '$2'); 501 | 502 | //--- Get possible paths for the current page: 503 | var pathNodes = location.pathname.split ('/').map ( function (pathWord) { 504 | return '/' + pathWord; 505 | } ); 506 | var cookPaths = [''].concat (pathNodes.map ( function (pathNode) { 507 | if (this.pathStr) { 508 | this.pathStr += pathNode; 509 | } 510 | else { 511 | this.pathStr = '; path='; 512 | return (this.pathStr + pathNode); 513 | } 514 | return (this.pathStr); 515 | } ) ); 516 | 517 | // eslint-disable-next-line no-func-assign 518 | ( eraseCookie = function (cookieName) { 519 | //--- For each path, attempt to delete the cookie. 520 | cookPaths.forEach ( function (pathStr) { 521 | //--- To delete a cookie, set its expiration date to a past value. 522 | var diagStr = cookieName + '=' + pathStr + '; expires=Thu, 01-Jan-1970 00:00:01 GMT;'; 523 | document.cookie = diagStr; 524 | 525 | document.cookie = cookieName + '=' + pathStr + '; domain=' + domain + '; expires=Thu, 01-Jan-1970 00:00:01 GMT;'; 526 | document.cookie = cookieName + '=' + pathStr + '; domain=' + domain2 + '; expires=Thu, 01-Jan-1970 00:00:01 GMT;'; 527 | document.cookie = cookieName + '=' + pathStr + '; domain=' + domain3 + '; expires=Thu, 01-Jan-1970 00:00:01 GMT;'; 528 | } ); 529 | } ) (cookieName); 530 | } 531 | --------------------------------------------------------------------------------