Block Jamin

Hides all posts and threads from LetsRun.com's user 'jamin'

当前为 2017-02-14 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Block Jamin
  3. // @namespace http://www.letsrun.com
  4. // @description Hides all posts and threads from LetsRun.com's user 'jamin'
  5. // @include *
  6. // @version 1.0
  7. // ==/UserScript==
  8.  
  9. var authors = document.getElementsByClassName('author');
  10.  
  11. if (authors.length > 0) {
  12. for (i = 0; i < authors.length; i++) {
  13. reg = authors[i].getElementsByTagName('strong');
  14. if (reg.length > 0) {
  15. regname = reg[0].innerHTML;
  16. if (regname == 'jamin') {
  17. child = authors[i].parentElement.parentElement;
  18. child.parentElement.removeChild(child);
  19. }
  20. }
  21. }
  22. }
  23.  
  24. var post_authors = document.getElementsByClassName('post_author');
  25.  
  26. if (post_authors.length > 0) {
  27. for (i = 0; i < post_authors.length; i++) {
  28. regname = post_authors[i].innerHTML;
  29. if (regname == 'jamin') {
  30. child = post_authors[i].parentElement.parentElement;
  31. child.parentElement.removeChild(child);
  32. }
  33. }
  34. }