Created
October 16, 2023 03:58
-
-
Save abraxas86/f77c3776b18834d981ecda7fbd66c7fc to your computer and use it in GitHub Desktop.
Itch.io paid content toggler
This file contains 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