Block Jamin

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

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

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