Alcuinus

Remove a Deviant from Group Watch

Jun 29th, 2011
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name           My DA REMOVE UNWANTED DEVIANT Script >:(
  3. // @description    I watch a group on DA... but there is one guy I can't stand... this auto deletes him
  4. // @author         Alcuinus
  5. // @include        http://*.deviantart.com/messages*
  6. // @version        1.0
  7. // ==/UserScript==
  8.  
  9. // Alcuinus: Tested in chrome
  10. // [name]: Tested in [browser]
  11.  
  12. document.getElementsByClassName("messages-right")[0].addEventListener('DOMSubtreeModified', function(e){
  13.  
  14.   if (e.target.host.substr(0,e.target.host.indexOf(".")) == "devianttoremove")
  15.   {
  16.     var obj = e.target;
  17.     while (obj.className != "ch-ctrl mc-ctrl"){
  18.       obj = obj.parentNode;
  19.     }
  20.     obj = obj.getElementsByClassName("mcx")[0];
  21.     var evt = document.createEvent("HTMLEvents");
  22.     evt.initEvent("click", true, true);
  23.     obj.dispatchEvent(evt);
  24.   }
  25.  
  26. }, false);
Add Comment
Please, Sign In to add comment