NoSerg121

Скрывает активность Serg121

当前为 2021-07-18 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name NoSerg121
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2
  5. // @description Скрывает активность Serg121
  6. // @author S30N1K
  7. // @match https://dota2.ru/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (() => {
  12. const banned = ["Serg121"]
  13.  
  14. const index = () => {
  15. const themes = $(".index__left-bar > .forum.component-block.component-block__hide-after-12 > ul > li")
  16. for (const theme of themes){
  17. const $theme = $(theme)
  18. const userNick = $theme.find(".component-text-grey-11").html().split("<")[0].trim()
  19. if (banned.includes(userNick)){
  20. $theme.remove()
  21. }
  22. }
  23. }
  24.  
  25. const members = () => {
  26.  
  27. }
  28.  
  29. const notifications = () => {
  30.  
  31. }
  32.  
  33. const forums = () => {
  34. const themes = $(".forum-section__list > li")
  35. for (const theme of themes) {
  36. const $theme = $(theme)
  37. const userNick = $theme.find(".forum-section__name > a")
  38. if (banned.includes(userNick)){
  39. $theme.remove()
  40. }
  41. }
  42. }
  43.  
  44. const threads = () => {
  45. const messages = $(".forum-theme__list > li")
  46. for (const message of messages) {
  47. const $message = $(message)
  48. const userNick = $message.find(".forum-theme__item-left-mob > a").html().trim()
  49. if (banned.includes(userNick)){
  50. $message.remove()
  51. }
  52. }
  53. }
  54.  
  55.  
  56. const pages = {
  57. "^\/$": index,
  58. "\/forum\/members\/(.+?)\/": members,
  59. "\/forum\/notifications\/": notifications,
  60. "\/forum\/threads\/": threads,
  61. "\/forum\/forums\/(.+?)\/": forums,
  62. }
  63.  
  64. for (const e of Object.keys(pages)) {
  65. if (new RegExp(e).test(window.location.pathname)) {
  66. pages[e]()
  67. }
  68. }
  69. })()