Skip to content

Instantly share code, notes, and snippets.

@aequabit
Created May 8, 2025 00:25
Show Gist options
  • Save aequabit/455f0b8aebe1fb6d7f025f24562b4a96 to your computer and use it in GitHub Desktop.
Save aequabit/455f0b8aebe1fb6d7f025f24562b4a96 to your computer and use it in GitHub Desktop.
Watch2Gether - Move Fullscreen Button
// ==UserScript==
// @name Watch2Gether - Move Fullscreen Button
// @match https://*.w2g.tv/*
// @grant none
// @version 0.0.2
// @author aequabit
// @description Moves the fullscreen button out of the settings submenu, next to it.
// @updateURL https://gist.github.com/aequabit/455f0b8aebe1fb6d7f025f24562b4a96/raw/w2g-move-fullscreen-btn.user.js
// ==/UserScript==
(async () => {
async function wait_for(conditional, interval = 100) {
return new Promise(resolve => {
const _wait_for_interval = setInterval(() => {
if (conditional() === true) {
clearInterval(_wait_for_interval);
resolve();
}
}, interval);
});
}
let fullscreenButton = null;
await wait_for(() => (fullscreenButton = document.getElementById("fullscreen_button")) !== null);
const fullscreenButtonLabel = fullscreenButton.querySelector(".popup_label");
if (fullscreenButtonLabel)
fullscreenButtonLabel.innerText = "";
const playerControls = document.getElementById("player_controls");
if (!playerControls)
return;
playerControls.appendChild(fullscreenButton);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment