Skip to content

Instantly share code, notes, and snippets.

@acegiak
Created February 26, 2023 13:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acegiak/7b31dd89e23810b5dd7c8b786606df58 to your computer and use it in GitHub Desktop.
Save acegiak/7b31dd89e23810b5dd7c8b786606df58 to your computer and use it in GitHub Desktop.
Tampermonkey/Greasemonkey: Automatically filter out horror games from itch.io
// ==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