Greasy Fork 支持简体中文。

Beamdog thread ignore script

Blocks specified threads or subforums on the Beamdog forums

  1. // ==UserScript==
  2. // @name Beamdog thread ignore script
  3. // @namespace https://greasyfork.org
  4. // @description Blocks specified threads or subforums on the Beamdog forums
  5. // @include https://forums.beamdog.com/*
  6. // @version 2
  7. // @grant none
  8. // @run-at document-ready
  9. // ==/UserScript==
  10.  
  11. // With this script you can ignore threads. These threads will be ignored on the "Recent Discussions" page
  12. // AND on their respective subforum discussion page.
  13. // You can also choose to ignore a subforum. ALL the threads from ALL subforums with that name will be ignored on the "Recent Discussions" page
  14.  
  15. // Add the title of a thread to this list. Enclose the thread's title with double quotes.
  16. // Separate different thread titles by a comma.
  17. var threadlist = [
  18. "Guess Facts about the Next Poster", "Finally an ignore feature!"
  19. ];
  20.  
  21. // Add the name of a subforum to this list in the same way as above. ATTENTION! On our forum there are multiple subforums
  22. // that have the same name. If you enter a name in this list, then ALL the threads from ALL the subforums with that
  23. // name will be ignored!
  24. var subforumlist =[
  25. ];
  26.  
  27. var threadsToDelete = document.querySelectorAll(".Title");
  28. var subforumsToDelete = document.querySelectorAll(".Category a");
  29.  
  30. var url = window.location.href;
  31. var sub1 = "discussions";
  32. var sub2 = "categories";
  33.  
  34. // case: URL contains "discussion"
  35. if (url.indexOf(sub1) !== -1 ) {
  36.  
  37. //delete subforums
  38. for (var i=0; i < subforumsToDelete.length; i++) {
  39. if (subforumlist.indexOf(subforumsToDelete[i].textContent) > -1) {
  40. subforumsToDelete[i].parentNode.parentNode.parentNode.parentNode.style.display = 'none';
  41. }
  42. }
  43. }
  44.  
  45. //case: URL contains "discussion" OR "categories"
  46. if (url.indexOf(sub1) !== -1 || url.indexOf(sub2) !== -1){
  47. //delete threads
  48. for (var i=0; i < threadsToDelete.length; i++) {
  49. if (threadlist.indexOf(threadsToDelete[i].textContent) > -1) {
  50. threadsToDelete[i].parentNode.parentNode.parentNode.style.display = 'none';
  51. }
  52. }
  53. }