Created
February 26, 2023 13:43
-
-
Save acegiak/7b31dd89e23810b5dd7c8b786606df58 to your computer and use it in GitHub Desktop.
Tampermonkey/Greasemonkey: Automatically filter out horror games from itch.io
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Remove Horror From Itch | |
| // @match *://itch.io/* | |
| // @run-at document-start | |
| // @grant none | |
| // @description add exclude horror filter to all itch.io pages | |
| // ==/UserScript== | |
| var oldUrlPath = window.location; | |
| var url = new URL(oldUrlPath); | |
| if(url.host.toLowerCase() == "itch.io"){ | |
| console.log("is itch"); | |
| if(url.searchParams.has("exclude")){ | |
| console.log("already has exclude"); | |
| }else{ | |
| console.log("has no exclude"); | |
| url.searchParams.set('exclude', "tg.horror"); | |
| var newURL = url.href | |
| window.location.replace (newURL); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment