Last active
November 24, 2023 02:19
-
-
Save shotasenga/dde981bd79af97ef85daa47fbc9d81fb to your computer and use it in GitHub Desktop.
#UserScript Define keyboard shortcuts to vote on Firepoker.io
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 Firepoker.io Bind Keys | |
// @namespace https://shotasenga.com/ | |
// @version 1.0.2 | |
// @description Define keyboard shortcuts to vote on Firepoker.io | |
// @author [email protected] | |
// @match https://firepoker.io/ | |
// @match https://firepoker.app/ | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
document.addEventListener('keyup', (e) => { | |
const result = document.evaluate(`//a[@ng-click="estimate(card)"][.=${e.key}]`, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null) | |
const button = result.singleNodeValue; | |
if (button?.offsetParent) { | |
button.click(); | |
} | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tampermonkey user script that defines keyboard shortcuts on Firepoker.io. Wfith this script, you can vote “3” by typing “3" on your keyboard.
Installation
firepoker.io-bind-keys.user.js
on this Gist