Skip to content

Instantly share code, notes, and snippets.

@Erquint
Last active April 19, 2020 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Erquint/69ee1acdc34fb9ec6c6f101bbfdcd0e2 to your computer and use it in GitHub Desktop.
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.
// ==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 gness.na@gmail.com
// @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