choggi, userstyles hide websites script is broken

edited April 2012 in userstyles.org
After "upgrading" to Pale Moon 11 and Greasemonkey 0.9.18 this script (along with many others, thanks Mozilla) stopped working.


// ==UserScript==
// @name userstyles hide websites
// @namespace http://choggi.dyndns.org
// @include http://forum.userstyles.org/*
// @include http://userstyles.org/*
// @include http://www.userstyles.org/*
// ==/UserScript==

//edit to suit your tastes (i = ignore case)
var hideThese = [/facebook/i,/twitter/i,/tumblr/i,/dashboard/i,/michael jackson/i,/orkut/i,/reddit/i,/linkedin/i,/jappy/i];

//list all links in page
var linkList = document.getElementsByTagName("a");
//loop through the links
for (var i = 0; i < linkList.length; i++){
var link = linkList[i].firstChild.textContent;
//then check with the user list
for (var j = 0; j < hideThese.length; j++){
if (link.match(hideThese[j]) != null){
//hide it
linkList[i].parentNode.style.display = "none";
//linkList[i].parentNode.setAttribute("class","spamSite");
if (linkList[i].parentNode.parentNode.parentNode.nodeName == "ARTICLE"){
linkList[i].parentNode.parentNode.parentNode.style.display = "none";
}
}
}
}


// ==UserScript==
// @name userstyles hide websites
// @namespace http://choggi.dyndns.org
// @include http://forum.userstyles.org/*
// @include http://userstyles.org/*
// @include http://www.userstyles.org/*
// ==/UserScript==

//edit to suit your tastes (i = ignore case)
var hideThese = [/facebook/i,/twitter/i,/tumblr/i,/dashboard/i,/michael jackson/i,/orkut/i,/reddit/i,/linkedin/i,/jappy/i];

//list all links in page
var linkList = document.getElementsByTagName("a");
//loop through the links
for (var i = 0; i < linkList.length; i++){
var link = linkList[i].firstChild.textContent;
//then check with the user list
for (var j = 0; j < hideThese.length; j++){
if (link.match(hideThese[j]) != null){
//hide it
linkList[i].parentNode.style.display = "none";
//linkList[i].parentNode.setAttribute("class","spamSite");
if (linkList[i].parentNode.parentNode.parentNode.nodeName == "ARTICLE"){
linkList[i].parentNode.parentNode.parentNode.style.display = "none";
}
}
}
}


And I also keep forgetting how the tags in this forum work.

Comments

  • edited April 2012
    Try deleting .firstChild from:
    var link = linkList[i].firstChild.textContent;
    To this:
    var link = linkList[i].textContent;
  • Webb,
    aren't you using srazzano' table view script? It has it all, you know.
  • Thanks, that works.

    I don't use table view script because it does too much - I rarely browse through styles - and it interferes with my own css.
Sign In or Register to comment.