Skip to content

Instantly share code, notes, and snippets.

@cmargroff
Created June 24, 2017 17:11
Show Gist options
  • Select an option

  • Save cmargroff/9b0aab2275f43910d5faedc5fb6b0a9f to your computer and use it in GitHub Desktop.

Select an option

Save cmargroff/9b0aab2275f43910d5faedc5fb6b0a9f to your computer and use it in GitHub Desktop.
// ==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