Skip to content

Instantly share code, notes, and snippets.

@jonvargas
Last active August 29, 2015 14:25
Show Gist options
  • Save jonvargas/dd6c7c77554e7d6405f9 to your computer and use it in GitHub Desktop.
Save jonvargas/dd6c7c77554e7d6405f9 to your computer and use it in GitHub Desktop.
/*
* Author: jonathan.vargas.cr
* Description:
*
* This script removes all popups displayed by La Nacion and El Financiero online newspapers.
* To apply, just open a Javascript console when you are reading an article, paste the script and execute it
*/
function byId (id) {
return document.getElementById(id);
}
function byClass (className) {
return document.getElementsByClassName(className);
}
function remove (elem) {
if (!elem)
return elem;
else
return elem.parentNode.removeChild(elem);
}
var div1 = byId ("alerta_suscripcion_paywall");
var div2 = ! div1 ? null : div1.previousElementSibling;
var div3 = byClass ("LNA_paywall_modal_wrapper")[0];
var div4 = ! div3 ? null : div3.previousElementSibling;
remove (div1);
remove (div2);
remove (div3);
remove (div4);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment