Advertisement
Guest User

Untitled

a guest
Jun 21st, 2013
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Techdirt Comment Filter
  3. // @namespace http://google.com
  4. // @description Forces threading, hides stupid comments and the idiots who reply
  5. // @author Sergey Brin
  6. // @include http://www.techdirt.com/*
  7. // @include https://www.techdirt.com/*
  8. // @version 1.0
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. var loc = window.location.href;
  13. var param = "threaded=true";
  14. if (!(loc.match(param))) {
  15. var locsuffix=(loc.match(/\?/))?"&threaded=true":"?threaded=true";
  16. window.location.replace(loc + locsuffix);
  17. }
  18. var cmt = document.body.querySelectorAll("li.cmt");
  19. for(var i=0;i<cmt.length;i++)if(cmt[i].innerHTML.match(/out_of_the_blue|mikey|milk/gim)){
  20. var tr = cmt[i];
  21. tr.style.display="none";
  22.  
  23. if(tr.nextElementSibling.nodeName == "UL"){
  24. tr.nextElementSibling.style.display="none";
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement