Zren / ResizeYoutubePlayerToWindowSize

Userscript: Moves the YouTube video to the top of the website and fill the window with the video player.
160 stars 13 forks source link

YT pushed some update it seems #79

Closed black-ish closed 1 year ago

black-ish commented 1 year ago

Youtube seems to have updated something, while resizing still works the playlist and parts of the description is now over the video. 2023 08 17_16:47:01_Wnj89TMe8O

There is also quite a bit of black space above the video now. 2023 08 17_16:47:10_52eL13bke4

I deactiavted all other scripts to check which one it is, it seems to be this one which is why I'm posting it here, hopefully someone else can confirm it.

Zren commented 1 year ago

Can't reproduce atm with Linux Firefox v116 or Linux Chromium v116. I'll keep checking over the next couple of days to see if I get the A/B test.

Last time I tried using someone elses VISITOR_INFO1_LIVE cookie, it didn't work. So maybe I need the YSC cookie too. It took a few weeks for me and others to see the A/B test.

black-ish commented 1 year ago

This is CentBrowser, which is a Chromium based Browser. For the VISITOR_INFO1_LIVE I get: xKhLxvsUd44 For YSC I get: aaeNIQcsp68

I'll try to check with other Browsers, it just happened today, yesterday all worked fine.

black-ish commented 1 year ago

Ok this is interesting, with Pale Moon (XUL Based) I'm getting the same result as with CentBrowser. With Vivaldi it seems to work still, I'm checking if there are different scripts running.

Checked if different scripts, but no, disabling every other script and only leaving "ResizeYoutubePlayerToWindowSize" enabled will create that result on both Browsers (Pale Moon and CentBrowser (CentBrowser based on Chromium 102)) but not on Vivaldi which uses Chromium 106.

Update: This is weird, very weird. Removing said cookies and reloading the page fixed it, it seems. But I got the same "black space" at the top for a bit there even on the main Youtube page, which may be something else then... Maybe something having to do with the ad-block crackdown they are doing....

Zren commented 1 year ago

Ok this is interesting, with Pale Moon (XUL Based) I'm getting the same result as with CentBrowser.

The A/B test might be IP/Country based.

Using those cookies doesn't seem to work, so I'll stop asking for them in the future.

But I got the same "black space" at the top for a bit there even on the main Youtube page, which may be something else then...

That's probably from #76 which appears when you use the back button.

Vamael commented 1 year ago

Can confirm on Firefox 107.0.1 on Windows. Disabling min-height, height and position in div id="player-full-bleed-container" class="style-scope ytd-watch-flexy" seems to fix it. @black-ish For now, you can fix it by maunally editing the script by adding scriptSelector + ' #player-full-bleed-container.ytd-watch-flexy', on line ~600, just under scriptSelector + ' ytd-watch-flexy[fullscreen] #player-wide-container.ytd-watch-flexy', That is, if youtube pushed the same update to us

AndrewTheWookiee commented 1 year ago

Having the same issues, adding the line Vamael posted fixes it.

iPaulis commented 1 year ago

I can confirm the same problem on Firefox v116.0.3 on Windows, it was just pushed a couple of minutes ago for me, as I was watching youtube, previous tabs were just fine, and suddenly it started happening in any new one. Now if I refresh any of the previously correctly loaded tabs, they apply the new youtube changes and break.

Slyceth commented 1 year ago

Can confirm on Firefox 107.0.1 on Windows. Disabling min-height, height and position in div id="player-full-bleed-container" class="style-scope ytd-watch-flexy" seems to fix it. @black-ish For now, you can fix it by maunally editing the script by adding scriptSelector + ' #player-full-bleed-container.ytd-watch-flexy', on line ~600, just under scriptSelector + ' ytd-watch-flexy[fullscreen] #player-wide-container.ytd-watch-flexy', That is, if youtube pushed the same update to us

You are amazing, every time it breaks I just go to this thread and you have a solution. You need to teach us how you figure out this stuff!

tordenflesk commented 1 year ago

Having the same issues, adding the line Vamael posted fixes it.

There's a "scroll" that happens that doesn't get corected for though:

https://i.imgur.com/XkcUoaz.png

Schleifenkratzer commented 1 year ago

beautiful fix, thanks a lot :)

Zren commented 1 year ago

Quickly added @Vamael's fix. If there's any minor issues I'll fix them after lunch.

black-ish commented 1 year ago

Updated to version 133 for a first try it seems to work fine :) Thank you guys for confirming and giving the instructions to fix and updating the script :)

marvtobi commented 1 year ago

Thanks zren! 133v fix works for me on current up to date Firefox and with Greasemonkey

Zren commented 1 year ago

There's a "scroll" that happens that doesn't get corected for though:

@tordenflesk: I can't reproduce this. Is it caused by Youtube? or another Youtube extension? It sounds similar to #58.

tordenflesk commented 1 year ago

There's a "scroll" that happens that doesn't get corected for though:

@tordenflesk: I can't reproduce this. Is it caused by Youtube? or another Youtube extension? It sounds similar to #58.

Apperas to have been temporary between manually applying @vamael's fix and v133

tordenflesk commented 1 year ago

Issue shows up again today: image

Vamael commented 1 year ago

Yep, youtube changed something again. For now, manually update the script by adding scriptSelector + ' ytd-watch-flexy[full-bleed-player] #full-bleed-container.ytd-watch-flexy', on line ~600, just under scriptSelector + ' ytd-watch-flexy[full-bleed-player] #player-full-bleed-container.ytd-watch-flexy',

@Zren Can you update the script again? :)

Tharn commented 1 year ago

Made me think there was something wrong with my GPU... thanks YouTube. :')

Actually, thank you Zren for an amazing userscript.

Zren commented 1 year ago

Thanks again @Vamael. Looks like the CSS moved the position: relative to another wrapper div.

evkaw commented 1 year ago

YouTube broke it again, lmao

Tharn commented 1 year ago

It did? All working as intended here, with the script update from last week.

marcelbrode commented 1 year ago

It did? All working as intended here, with the script update from last week.

Not for me using Chrome on Win10. The patch only helped for like a day and went back to the broken state:

ZNyJ3w2 1

Zren commented 1 year ago

@evkaw: Youtube broke twice this past week fixed in ResizeYT v133, then again in v134. If you are sure you are using v134, then can you do the following:

  1. Open Youtube while logged out (Eg: Chrome Incognito or Firefox Private mode) to avoid any personal data that might be in the HTML. Note that I will still be able to see the video id.
  2. Open the DevTools with F12
  3. Click the Console tab at the top.
  4. Copy the following JavaScript.
  5. Click the input text field next to the > at the bottom:
  6. Paste the script, then hit Enter.
  7. Copy the output text
    • Firefox: Right Click text > Copy Object
    • Chrome: Select all text > Copy
  8. Paste it here as a comment.
    ytwp.debugPage = function() {
        function prettyHtml(el) {
            var s = el.outerHTML
            return s.substr(0, s.indexOf('>')+1)
        }
        var defStyle = {
            'display':'block', 'position': 'static',
            'left': 'auto', 'right': 'auto', 'top': 'auto', 'bottom': 'auto',
            'padding-left':'0px', 'padding-right':'0px', 'padding-top':'0px', 'padding-bottom':'0px',
            'margin-left':'0px', 'margin-right':'0px', 'margin-top':'0px', 'margin-bottom':'0px',
            'width': 'auto', 'min-width': 'auto', 'max-width': 'auto',
            'height': 'auto', 'min-height': 'auto', 'max-height': 'auto',
        }
        var keyFilter = Object.keys(defStyle)
        var node = document.querySelector('#movie_player video')
        var outStr = ''
        while (node && node.parentNode) {
            var style = getComputedStyle(node)
            var styleDiff = {}
            for (var key of style) {
                if (keyFilter.includes(key) && style[key] != defStyle[key]) {
                    styleDiff[key] = style[key]
                }
            }
            outStr += prettyHtml(node) + ' ' + JSON.stringify(styleDiff) + '\n'
            node = node.parentNode
        }
        outStr = outStr.split('\n').reverse().join('\n')
        ytwp.log('debugPage', outStr)
    }
    ytwp.debugPage()

Eg: Screenshot_20230830_105242

Screenshot_20230830_110349

<html style="font-size: 10px;font-family: Roboto, Arial, sans-serif;" lang="en-GB" dark="" system-icons="" typography="" typography-spacing="" darker-dark-theme="" darker-dark-theme-deprecate=""> {"height":"3461px","max-height":"none","max-width":"none","min-height":"0px","min-width":"0px","width":"1600px"}
<body dir="ltr" rounded-container="" modern-dialog="" class="ytwp-window-player ytwp-scrolltop ytwp-viewing-video"> {"height":"2657.67px","margin-top":"803.333px","max-height":"none","max-width":"none","min-height":"0px","min-width":"0px","width":"1600px"}
<ytd-app darker-dark-theme=""> {"height":"2657.67px","left":"0px","max-height":"none","max-width":"none","min-height":"100%","min-width":"0px","right":"0px","top":"0px","width":"1600px"}
<div id="content" class="style-scope ytd-app"> {"height":"2657.67px","max-height":"none","max-width":"none","min-height":"0px","min-width":"0px","width":"1600px"}
<ytd-page-manager id="page-manager" class="style-scope ytd-app"> {"display":"flex","height":"2657.67px","margin-top":"56px","max-height":"none","max-width":"none","min-height":"0px","min-width":"0px","width":"1600px"}
<ytd-watch-flexy class="style-scope ytd-page-manager hide-skeleton" theater-requested_="" js-panel-height_="" flexy-enable-small-window-sizing="" flexy-enable-large-window-sizing="" cinematics-enabled="" flexy="" rounded-info-panel="" is-dark-theme="" is-four-three-to-sixteen-nine-video_="" theater="" full-bleed-player="" watch-metadata-refresh="" is-two-columns_="" flexy-large-window_="" style="--ytd-watch-flexy-scrollbar-width: 0px; --ytd-watch-flexy-space-below-player: 136px; --ytd-watch-flexy-panel-max-height: 460px; --ytd-watch-flexy-chat-max-height: 460px; --ytd-watch-flexy-structured-description-max-height: 460px; --ytd-watch-flexy-comments-panel-max-height: 460px; --ytd-comments-engagement-panel-content-height: 460px;" role="main" video-id="BYRdRSon1Bo"> {"height":"2586.67px","max-height":"none","max-width":"none","min-width":"0px","padding-top":"71px","width":"1600px"}
<div id="full-bleed-container" class="style-scope ytd-watch-flexy"> {"display":"flex","height":"0px","max-height":"634.333px","max-width":"none","min-height":"0px","min-width":"0px","width":"1600px"}
<div id="player-full-bleed-container" class="style-scope ytd-watch-flexy"> {"height":"0px","max-height":"none","max-width":"none","min-height":"0px","width":"1600px"}
<div id="player-container" role="complementary" class="style-scope ytd-watch-flexy" style="touch-action: auto;"> {"bottom":"0px","height":"803.333px","left":"0px","max-height":"803.333px","max-width":"100%","min-height":"803.333px","min-width":"100%","position":"absolute","right":"0px","top":"0px","width":"1600px"}
<ytd-player id="ytd-player" context="WEB_PLAYER_CONTEXT_CONFIG_ID_KEVLAR_WATCH" class="style-scope ytd-watch-flexy"> {"height":"803.333px","max-height":"none","max-width":"none","min-height":"0px","min-width":"0px","width":"1600px"}
<div id="container" class="style-scope ytd-player"> {"height":"803.333px","max-height":"none","max-width":"none","min-height":"0px","min-width":"0px","width":"1600px"}
<div class="html5-video-player ytp-transparent ytp-exp-bottom-control-flexbox ytp-exp-ppp-update ytp-hide-info-bar ytp-large-width-mode ytp-fine-scrubbing-exp ytp-fit-cover-video ytp-autonav-endscreen-cancelled-state ytp-heat-map paused-mode" tabindex="-1" id="movie_player" data-version="/s/player/16f9263d/player_ias.vflset/en_GB/base.js" aria-label="YouTube Video Player"> {"bottom":"0px","height":"803.333px","left":"0px","max-height":"803.333px","max-width":"100%","min-height":"803.333px","min-width":"100%","position":"relative","right":"0px","top":"0px","width":"1600px"}
<div class="html5-video-container" data-layer="0"> {"bottom":"0px","height":"803.333px","left":"0px","max-height":"803.333px","max-width":"100%","min-height":"803.333px","min-width":"100%","position":"relative","right":"0px","top":"0px","width":"1600px"}
<video tabindex="-1" class="video-stream html5-main-video" controlslist="nodownload" style="width: 1428px; height: 803px; left: 86px; top: 0px;" src="blob:https://www.youtube.com/ac36bcdd-eedc-4b21-b414-034fe8f23f8a"> {"bottom":"0px","height":"803.333px","left":"0px","max-height":"803.333px","max-width":"100%","min-height":"803.333px","min-width":"100%","position":"absolute","right":"0px","top":"0px","width":"1600px"}
evkaw commented 1 year ago

I would love to help, but YouTube has updated the UI but the update does not show up in Incognito. This is the new UI I see:

image

Weird thing is I only see this on this one single account but any other youtube account shows the original interface so I guess it's not that important right now.

Zren commented 1 year ago

Hmm, interesting, Since it's Youtube JP, it could be a unique layout for Japanese language, or just another A/B test with Japan as the test market. If it's an A/B test, then I'll probably see it in a few weeks.


Anyways, I don't see any personal info in my HTML output, but if you're willing to run the script you can email me privately with the output.

My email is at the top of this page: https://github.com/Zren/ResizeYoutubePlayerToWindowSize/commit/b53d408d303b7396c67c1151ea29fd6e2f7fae88.patch

Zren commented 1 year ago

Or it's a unique layout just for Youtube Shorts. Does it also affect normal videos?

evkaw commented 1 year ago

yea, that's not a youtube short and also, I don't think its special to JP cause every account is in JP for me. Though I'll try the script

evkaw commented 1 year ago

Don't know if I'm doing something wrong, but this is what I get as an output:

VM3911:1 Uncaught ReferenceError: ytwp is not defined at :1:5