Steam Community - Comments Remover

More options to delete comments

  1. // ==UserScript==
  2. // @name Steam Community - Comments Remover
  3. // @namespace Royalgamer06
  4. // @version 0.1
  5. // @description More options to delete comments
  6. // @author Royalgamer06
  7. // @match *://steamcommunity.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. var interval = 1000;
  12.  
  13. if (jQuery("[href*='CCommentThread.DeleteComment']").length > 0) {
  14. jQuery("[href*='CCommentThread.DeleteComment']").after('<a class="actionlink"> | </a><a class="actionlink delAllComments">Delete Everything</a><a class="actionlink"> | </a><a class="actionlink delAuthorComments">Delete Everything From This Author</a>');
  15. jQuery(".delAllComments").click(function() {
  16. if (confirm("Are you sure you want to delete all comments?")) {
  17. var delComments = setInterval(function() {
  18. if (jQuery("[href*='CCommentThread.DeleteComment']").length > 0) {
  19. eval(jQuery("[href*='CCommentThread.DeleteComment']").attr("href"));
  20. } else {
  21. clearInterval(delComments);
  22. }
  23. }, interval);
  24. }
  25. });
  26. jQuery(".delAuthorComments").click(function() {
  27. if (confirm("Are you sure you want to delete all comments from this author?")) {
  28. var author = jQuery(this).parent().find(".commentthread_author_link").attr("data-miniprofile");
  29. var delComments = setInterval(function() {
  30. if (jQuery(".commentthread_comment_author [data-miniprofile=" + author + "]").length > 0) {
  31. jQuery(".commentthread_comment_author [data-miniprofile=" + author + "]").each(function() {
  32. eval(jQuery(this).parent().find("[href*='CCommentThread.DeleteComment']").attr("href"));
  33. });
  34. } else if (jQuery(".commentthread_pagelinks .active").first().next().length > 0) {
  35. jQuery(".commentthread_pagelinks .active").first().next().click();
  36. } else {
  37. clearInterval(delComments);
  38. }
  39. }, interval);
  40. }
  41. });
  42. }