Last active
March 13, 2019 16:47
-
-
Save LucasMetal/0a0a93f182841250658d to your computer and use it in GitHub Desktop.
Greasemonkey script that prevents Clarín and La Nación digital newspapers from asking to log in to check the news ;)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Newspapers Login Remover | |
// @namespace LucasMetal | |
// @description Prevents Clarín and La Nación digital newspapers from asking to log in to check the news ;) | |
// @version 1 | |
// @match *://*.clarin.com/* | |
// @match *://*.ole.com/* | |
// @match *://*.lanacion.com.ar/* | |
// @grant none | |
// @author @paleta | |
// ==/UserScript== | |
console.log("Newspapers Login Remover: Loaded"); | |
setTimeout(function(){ | |
if (location.href.indexOf('clarin') > -1 || location.href.indexOf('ole.com') > -1) { | |
$("html").removeAttr('style'); | |
$("#colorbox").remove(); | |
$("#cboxOverlay").remove(); | |
} else { | |
var lnmodal = document.getElementsByClassName('lnmodal'); | |
if (lnmodal.length > 0) { | |
lnmodal[0].remove(); | |
} else { | |
lnmodal = document.getElementsByClassName('modal-scrollable'); | |
if (lnmodal.length > 0) { | |
lnmodal[0].remove(); | |
} | |
} | |
var style = document.createElement('style'); | |
style.type = 'text/css'; | |
style.appendChild(document.createTextNode('.modal-open { overflow: scroll !important }')); | |
document.getElementsByTagName('head')[0].appendChild(style); | |
} | |
}, 5 * 1000); //To make sure it's fully loaded |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment