Skip to content

Instantly share code, notes, and snippets.

@shotasenga
Last active November 24, 2023 02:19
Show Gist options
  • Save shotasenga/dde981bd79af97ef85daa47fbc9d81fb to your computer and use it in GitHub Desktop.
Save shotasenga/dde981bd79af97ef85daa47fbc9d81fb to your computer and use it in GitHub Desktop.
#UserScript Define keyboard shortcuts to vote on Firepoker.io
// ==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();
}
});
})();
@shotasenga
Copy link
Author

Tampermonkey user script that defines keyboard shortcuts on Firepoker.io. Wfith this script, you can vote “3” by typing “3" on your keyboard.

Installation

  1. Install Tampermonkey (Chrome / FireFox)
  2. Click the "Raw" button on the firepoker.io-bind-keys.user.js on this Gist
  3. Click "Install" button on the Tempermonkey screen
  4. You can test it here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment