讨论 » 创建请求

Youtube video automatic-fullscreen script (not just resizing the video, actual fullscreen that you get when you press F)

§
发表于:2024-08-06

I am looking for someone to create a script that automatically fullscreens youtube videos. I am not talking about resizing the video size like how theater mode resizes the video window because the tab menu bar of the browser will still be present at the top and the windows taskbar will still be present at the bottom. I am looking for a script that actually makes the video automatically open in fullscreen mode when I open a video link on youtube.com. What I mean by fullscreen mode I mean by the mode that activates when you press "F" on the keyboard when watching a youtube video. I have been linked scripts before that just resize the video to be slightly larger than theater mode that is not the fullscreen mode that you get when you press "F" on the keyboard.

§
发表于:2024-08-06
编辑于:2024-08-06

Some devs say that it is impossible so I haven't even tried it, although maybe I would be able to do that.
I did something that achieves pretty much the same thing, and people gave me good feedback in the past, seems like nothing else works or helps more than my script (although I haven't looked for a better working solution)
https://greatest.deepsurf.us/en/scripts/435669-redirect-yt-video-to-embedded-video

§
发表于:2024-12-03

its extremely easy, no idea why someone would say its not possible, dm me and i'll write it

§
发表于:2024-12-03

its extremely easy, no idea why someone would say its not possible, dm me and i'll write it

Maybe this is the issue
https://greatest.deepsurf.us/en/scripts/435669-redirect-yt-video-to-embedded-video/discussions/130326#comment-293195

§
发表于:2024-12-03

alright, well have a good day

§
发表于:2024-12-03

The dumbest way works document.querySelector("#movie_player > div.ytp-chrome-bottom > div.ytp-chrome-controls > div.ytp-right-controls > button.ytp-fullscreen-button.ytp-button").click();

But I think that JS commands that were made to do it wouldn't work maybe.

§
发表于:2024-12-03

its not that difficult, you just need to include childlist because of the fact its in the video, heres a piece i threw together as a demo, but can be improved upon to match your case


document.addEventListener('yt-navigate-finish', function() {
var clickInterval = setInterval(function() {
var fullscreenButton = document.querySelector('[title="Full screen (f)"]');

// If the button is found, click it and clear the interval
if (fullscreenButton) {
fullscreenButton.click();
clearInterval(clickInterval); // Stop trying after successful click
}
}, 100); // Click every 0.1 seconds
});

发表回复

登录以发表回复。