Tech Off Thread

1 post

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

greasemonkey anyone?

Back to Forum: Tech Off
  • User profile image
    harumscarum

    Has anyone put together any gm scripts for c9? I finally downloaded gm and put together a user filter:

    (function() {
    var divCollection= document.getElementsByTagName('DIV');
    var divAttr;
    var tableCollection;
    var userUrl;

    for(i=0;i<divCollection.length;i++){

            divAttr = divCollection[i].getAttribute('class');

     if ((divAttr!=null) && (divAttr=='replyHeadWrap')){
      tableCollection = divCollection[i].getElementsByTagName('TABLE');
      if(tableCollection.length>0){
       userUrl=tableCollection[1].childNodes[1].childNodes[0].childNodes[1].childNodes[1].childNodes[1];
       if((userUrl=='http://channel9.msdn.com/Niners/[put in user name here]')){   
        divCollection[i].style.display='none';
        divCollection[i+2].style.display='none';
       }
      }
      
     }
     
    }
    })();

    I hate referencing so many nodes by index but I was just scripting away Wink  Anywho any improvements here or any other scripts would be appreciated.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.