Created
June 24, 2017 17:11
-
-
Save cmargroff/9b0aab2275f43910d5faedc5fb6b0a9f to your computer and use it in GitHub Desktop.
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 Steam Tag Page Hotkeys | |
| // @namespace http://store.steampowered.com/ | |
| // @version 0.1 | |
| // @description Hotkeys for paging through discovery queue on tag pages | |
| // @author Chris Margroff | |
| // @match http://store.steampowered.com/tag/*/* | |
| // @grant none | |
| // ==/UserScript== | |
| //$J is Steam's alias for jQuery | |
| (function(w, $){ | |
| var KEYS = { | |
| RIGHT: 39, | |
| LEFT: 37 | |
| }; | |
| $dQ = $('#discovery_queue_1'); | |
| if ($dQ.length == 1) { | |
| w.addEventListener('keydown', function(e){ | |
| if (e.keyCode == KEYS.RIGHT) { | |
| var target = $(".dq_item.dq_pos_3", $dQ); | |
| }else if (e.keyCode == KEYS.LEFT) { | |
| var target = $(".dq_item.dq_pos_1", $dQ); | |
| } | |
| if (target) { | |
| console.log(target); | |
| target.click(); | |
| } | |
| }, false); | |
| } | |
| })(window, $J) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment