Remove annoying topics from Reddit

Remove annoying topics from Reddit by hiding posts that include specific keywords. Edit "const kWList" to change the keyword.

  1. // ==UserScript==
  2. // @name Remove annoying topics from Reddit
  3. // @name:it Rimuovi gli argomenti fastidiosi da Reddit
  4. // @namespace StephenP
  5. // @match https://www.reddit.com/*
  6. // @grant none
  7. // @version 0.1
  8. // @author StephenP
  9. // @description Remove annoying topics from Reddit by hiding posts that include specific keywords. Edit "const kWList" to change the keyword.
  10. // @description:it Rimuovi gli argomenti fastidiosi da Reddit nascondendo i post che includono determinate parole chiave. Modifica "const kWList" per cambiare le parole chiave.
  11. // @license CC-BY-NC-4.0
  12. // @contributionURL https://buymeacoffee.com/stephenp_greasyfork
  13. // ==/UserScript==
  14. (function(){
  15. const kWList=["Trump","Musk","Solana","crypto","coin"];
  16. var style=document.createElement("STYLE");
  17. style.innerText=generateCSS(kWList);
  18. document.head.appendChild(style)
  19. })();
  20.  
  21. function generateCSS(kWList){
  22. let css=""
  23. for(let k of kWList){
  24. css+="article[aria-label*="+k+"], ";
  25. }
  26. return css.slice(0,css.length-2)+"{display: none}";
  27. }