Last active
April 19, 2020 20:43
-
-
Save Erquint/69ee1acdc34fb9ec6c6f101bbfdcd0e2 to your computer and use it in GitHub Desktop.
Install via: https://gist.github.com/Erquint/69ee1acdc34fb9ec6c6f101bbfdcd0e2/raw/Watch2GetherHotkeys.user.js Installing with the `Raw` button can disable updates.
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 Watch 2 Gether hotkeys. | |
// @description Space or K plays/pauses, F enables fullscreen. ESC disabled fullscreen as per browsers convention. | |
// @version 1.0 | |
// @namespace [email protected] | |
// @author https://gist.github.com/Erquint | |
// @homepageURL https://gist.github.com/Erquint/69ee1acdc34fb9ec6c6f101bbfdcd0e2 | |
// @updateURL https://gist.github.com/Erquint/69ee1acdc34fb9ec6c6f101bbfdcd0e2/raw/Watch2GetherHotkeys.user.js | |
// @downloadURL https://gist.github.com/Erquint/69ee1acdc34fb9ec6c6f101bbfdcd0e2/raw/Watch2GetherHotkeys.user.js | |
// @match http*://*watch2gether.com*/* | |
// @run-at document-end | |
// @noframes | |
// @inject-into page | |
// @noframes | |
// @grant none | |
// ==/UserScript== | |
document.onkeyup = (x => { | |
if (x == KeyboardEvent.DOM_VK_SPACE || x == KeyboardEvent.DOM_VK_K) { | |
document.getElementsByClassName('w2g-play-button')[0].click(); | |
} else if (x == KeyboardEvent.DOM_VK_F) { | |
document.getElementsByClassName('w2g-dropdown')[1].getElementsByClassName('dd-item')[0].click(); | |
}; | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment