Greasy Fork is available in English.

simple-filtering

The simple tool filtering websites.

  1. // ==UserScript==
  2. // @name simple-filtering
  3. // @namespace https://github.com/PenguinCabinet
  4. // @version v0.0.1
  5. // @description The simple tool filtering websites.
  6. // @author PenguinCabinet
  7. // @license MIT
  8. // @match http://*/*
  9. // @match https://*/*
  10. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. //CONFIG
  15. let URL_blacklist = [
  16.  
  17. ];
  18. let Keyword_blacklist = [
  19.  
  20. ];
  21. //CONFIG
  22.  
  23.  
  24.  
  25. const redirect_URL = "https://example.com";
  26. function block_redirect() {
  27. location.replace(redirect_URL);
  28. }
  29.  
  30. (function () {
  31. URL_blacklist.forEach(function (e) {
  32. if (location.href.includes(e))
  33. block_redirect();
  34. });
  35.  
  36. Keyword_blacklist.forEach(function (e) {
  37. if (document.body.textContent.includes(e))
  38. block_redirect();
  39. });
  40.  
  41. 'use strict';
  42.  
  43. // Your code here...
  44. })();