Free Republic
Browse · Search
General/Chat
Topics · Post Article

To: paladinkc

here is a copy of the script i have
setInterval(removeSpam, 2000);
function removeSpam() {
var spanTags = document.getElementsByTagName(’span’);
var spamNames = [’Huffington Post’, ‘The Huffington Post’, ‘Salon’, ‘Salon.com’, ‘Vox’, ‘Vox.com’, ‘HuffPost’ ];
var found;
for (var i = 0; i < spanTags.length; i++) {
if (contains(spamNames, spanTags[i].textContent)) {
found = spanTags[i];
parentBlock = getParent(getParent(getParent(getParent(found))));
removeAllChildren(parentBlock);
}
}
}
function getParent(o) {
return o.parentNode;
}

function contains(a, obj) {
var i = a.length;
while (i—) {
if (a[i] === obj) {
return true;
}
}
return false;
}
function removeAllChildren(o) {
while (o.firstChild) {
o.removeChild(o.firstChild);


2 posted on 02/26/2018 3:21:13 AM PST by paladinkc (release the inmates and lock me up so they can pay for my vacation! Let them see how they like it!)
[ Post Reply | Private Reply | To 1 | View Replies ]


To: paladinkc

You dont need to write your own javascript. You should be able to find a browser add on (chrome, firefox..) that does that for you. Even better is to not use Yahoo at all.


7 posted on 02/26/2018 4:49:17 AM PST by libh8er
[ Post Reply | Private Reply | To 2 | View Replies ]

Free Republic
Browse · Search
General/Chat
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson