Last active
February 8, 2025 21:52
-
-
Save abraxas86/f77c3776b18834d981ecda7fbd66c7fc to your computer and use it in GitHub Desktop.
Itch.io paid content toggler
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 Itch.io Toggle paid games | |
// @namespace http://tampermonkey.net/ | |
// @version 1 | |
// @description Hide/Show non-free games from various itch.io pages. | |
// @author abraxas86 | |
// @match https://itch.io/* | |
// @require https://code.jquery.com/jquery-3.6.0.min.js | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=itch.io | |
// @grant none | |
// ==/UserScript== | |
/* globals jQuery, $ */ | |
(function() { | |
'use strict'; | |
var hidden = true; | |
$(document).keydown(function(smashed) | |
{ | |
if (smashed.ctrlKey && smashed.keyCode === 89) | |
{ togglePaid(); } | |
}); | |
function togglePaid() | |
{ | |
$(".game_cell").each(function() { | |
if (($(this).find(".price_value").length > 0) || ($(this).find(".price_tag").length > 0)) | |
{ | |
if (hidden == true) | |
{ $(this).show(); } | |
else | |
{ $(this).hide(); } | |
} | |
}); | |
if (hidden == true) | |
{ hidden = false; } | |
else | |
{ hidden = true; } | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just updated the file name. The "..' in there was bugging me for a long time - I was hoping to update it next time I changed the code, but I haven't had a need to change the code... 🤷♂️