Code Monkey home page Code Monkey logo

yttwthmode's People

Contributors

maquinas07 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

yttwthmode's Issues

Fails to detect theater mode (sometimes) - container's ID may have changed again

Sometimes when I turn on theater mode, yttwthmode seems to not notice - I end up with the regular YouTube theater mode. Digging into the code, I found that the #player-wide-container element doesn't seem to exist. However, there is a #player-full-bleed-container that looks like it could be the replacement for it. In my limited testing1, using #player-full-bleed-container as the theaterContainer seems to result in the correct layout as far as I can tell. (I see from #16 that this isn't the first time that element's ID has changed.)

However, in other sessions, yttwthmode seems to work just fine. That suggests that YouTube is still using the older ID sometimes, possibly as part of an A/B test. So it might be worth checking for both IDs with something like:

theaterContainer = document.getElementById("player-full-bleed-container") || document.getElementById("player-wide-container");

or maybe even something like this, in case they change it yet again:

// Get the first descendant of the pageManagerContainer whose ID looks like player-*-container
theaterContainer = pageManagerContainer.querySelector('[id^="player-"][id$="-container"]:not(#player-container)')

Footnotes

  1. I set a breakpoint at the equivalent of reloadPageElems, reloaded the video page, then used the console to wrap the getElementById function: const oldByID = document.getElementById; document.getElementById = function(id) { if(id === 'player-wide-container') id = 'player-full-bleed-container'; return oldByID.call(this, id); } โ†ฉ

Layout BUG

YouTube is currently conducting A/B testing with various layouts. This occurs occasionally when you are logged in, but always happens when you are not. One way to replicate this is by opening a YouTube livestream in incognito mode.

Here is a screenshot for reference:

image

Layout bug

Had this issue since last month. Tried with Google Chrome and Firefox. Any idea how to fix this?

Screenshot 2023-12-01 144607

Feature request: an enable/disable button

Hi, thanks for the great work.
The hide chat button is good, but it is slightly different from the original theater mode (The search bar on the top ...etc).
If there's an enable/disable button than that would be great.

Video extends behind chat, and has title, description etc. overlaid on top of it

Looks like YouTube has changed the page structure yet again. There's still a #player-full-bleed-container element, but it's been wrapped in another element #full-bleed-container that sits between it and the ytd-watch-flexy.ytd-page-manager. yttwthmode targets the inner one, and as a result, the player ends up partway under the chat, and the video information (title, description, and so on) appear overlaid on top of the video. Using the devtools to convince the extension to target #full-bleed-container instead seems to result in the correct layout again.

I'm not sure yet if this one is being A/B tested or not, but if you want to continue supporting the old structure as well, I can think of two ways to do this:

  1. Update the querySelector call to look for two different selectors:
theaterContainer = pageManagerContainer.querySelector(
	'#full-bleed-container, ' +
	'[id^="player-"][id$="-container"]:not(#player-container)'
);

querySelector will just return the first element it finds that matches either selector. That will be the outer #full-bleed-container if it's there, and the #player-*-container otherwise.

  1. Use the existing selector, but then back out until you reach a direct child of ytd-watch-flexy.ytd-page-manager:
theaterContainer = pageManagerContainer.querySelector('[id^="player-"][id$="-container"]:not(#player-container)');
theaterContainer = theaterContainer.closest('ytd-watch-flexy.ytd-page-manager > *');

That second line will do nothing if theaterContainer already is a direct child, like in the old structure.

I'm not sure which of those is more likely to keep working as YouTube continues changing things.

Bug when chat is hidden

When chat is hidden and theater mode is activated the addon reserves space for the chat frame but doesn't show chat

Turning on Theatre Mode causes the top-bar to disappear

Turning on the Threatre Mode causes the upper bar to fully disappear (it turns fully black).
The search bar and all other elements, which you can usually find in the top bar, disappear and that behaviour stays consistent for all other YT tabs as well.

This means if I have one YT video opened in Theatre Mode, but open a 2nd YT tab (on e.g. the homepage or subscription page), then in that 2nd YT tab I will not be able to enter anything into the search bar, as it is gone.

grafik

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.