Skip to content

Instantly share code, notes, and snippets.

@WinkelCode
Last active April 23, 2023 21:49
Show Gist options
  • Save WinkelCode/d2fd76426974119e9eacaf1d706212e4 to your computer and use it in GitHub Desktop.
Save WinkelCode/d2fd76426974119e9eacaf1d706212e4 to your computer and use it in GitHub Desktop.
YouTube Ultrawide Fullscreen Bookmarklet
// Bookmarklet will fullscreen the video and fill the screen
// Might not work on Chromium derivatives, probably same issue: https://github.com/dvlden/ultrawideo/issues/94
// One line
javascript:(function(){var e=document.querySelector(".ytp-fullscreen-button");if(e){e.click();setTimeout(function(){var e=document.querySelector("video");if(e){e.style.width="100vw",e.style.height="100vh",e.style.left="0px",e.style.top="0px"}},250)}})();
//Pretty + Comments
javascript:(function(){
// Find the fullscreen button element
var fullscreenButton = document.querySelector(".ytp-fullscreen-button");
// If the button exists, click it and wait 250ms
if (fullscreenButton) {
fullscreenButton.click();
setTimeout(function(){
// Find the video element
var video = document.querySelector("video");
// If the video element exists, make it fullscreen
if (video) {
video.style.width = "100vw";
video.style.height = "100vh";
video.style.left = "0px";
video.style.top = "0px";
}
}, 250);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment