Greasy Fork Content Filter

Filter out unwanted content on Greasy Fork

  1. // ==UserScript==
  2. // @name Greasy Fork Content Filter
  3. // @namespace https://openuserjs.org/
  4. // @description Filter out unwanted content on Greasy Fork
  5. // @include http*://greasyfork.org/en/scripts*
  6. // @version 1.0
  7. // @grant GM_addStyle
  8. // ==/UserScript==
  9.  
  10. GM_addStyle(".width-constraint {max-width: 1180px !important}");
  11.  
  12. var entrytitles = ["Agar.io", "OGARio", "Slither.io", "Diep.io"];
  13.  
  14. var nodes = document.evaluate("//ol[@class='script-list']/li/article/h2/a | //ol[@class='script-list']/li/article/h2/span[@class='description']", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
  15.  
  16. for (var i = 0; i < nodes.snapshotLength; i++) {
  17. var curScript = nodes.snapshotItem(i).textContent.toString();
  18. for (var j = 0; j < entrytitles.length; j++) {
  19. var x = new RegExp("\\b" + entrytitles[j] + "\\b", "gi");
  20. if (curScript.match(x)) {
  21. nodes.snapshotItem(i).parentNode.parentNode.parentNode.style.display = 'none';
  22. break;
  23. }
  24. }
  25. }