Greasy Fork is available in English.

Youtube No Flexy Mode

Disable Flexy Mode

< Feedback on Youtube No Flexy Mode

مراجعة: Good - script works

§
Posted: 22-05-2018

Does not work until reloading the page or go straight into the video link...

As title says, maybe you should do something so that it will work great with the HTML history API.

Botanمؤلف
§
Posted: 22-05-2018

Yes. I didn't try that condition. But you are right. The problem is that EXPERIMENTFLAGS.kevlarflexywatchnew_dom has to be set as soon as possible. That's why I've updated the script. For me youtube now looks like it should do, no matter if i first visit the homepage or a video.

§
Posted: 23-05-2018

@Botan said: Yes. I didn't try that condition. But you are right. The problem is that EXPERIMENTFLAGS.kevlarflexywatchnew_dom has to be set as soon as possible. That's why I've updated the script. For me youtube now looks like it should do, no matter if i first visit the homepage or a video.

Well, it kinda works here, but did you just make the code to run constantly?

Botanمؤلف
§
Posted: 23-05-2018

Yes and no. Since the object 'yt' and the element 'movie_player' may not be available at document-start, I used timers who check the accessibility. As soon as they are, clearTimer is called to stop those check since only one call is required.

§
Posted: 23-05-2018

@Botan said: Yes and no. Since the object 'yt' and the element 'movie_player' may not be available at document-start, I used timers who check the accessibility. As soon as they are, clearTimer is called to stop those check since only one call is required.

// @run-at document-end

(function() { 'use strict'; if (window.top != window.self) return; console.log('Youtube No Flexy Mode'); var ytPlayer; function setBackground () { ytPlayer = document.getElementById("movie_player") || document.getElementsByClassName("html5-video-player")[0]; if (ytPlayer) { ytPlayer.style.background='#000000'; console.log('Set player background color to #000000!'); } }; function ytNoFlexy() { if (typeof window.yt === "undefined" || window.yt.config_.EXPERIMENT_FLAGS.kevlar_flexy_watch_new_dom === false) return; else { window.yt.config_.EXPERIMENT_FLAGS.kevlar_flexy_watch_new_dom = false; console.log('Flexy disabled!'); } } ytNoFlexy(); setBackground(); document.addEventListener("yt-navigate-start", ytNoFlexy, true); document.addEventListener("yt-navigate-finish", setBackground, true); })();

I got this to run ok on my side (don't laugh if my method is too stupid, I'm not good at this :pensive: ), what do you think about this? By the way, why do you set background to #000000? Maybe I didn't look carefully, but I hardly noticed anything weird without it :/

Botanمؤلف
§
Posted: 23-05-2018

Uh that looks good. Can I use your version and apply it to greasyfork ?. Well I noticed that on videos like https://www.youtube.com/watch?v=v2AC41dglnM the background color seems to be transparent.

§
Posted: 23-05-2018

@Botan said: Uh that looks good. Can I use your version and apply it to greasyfork ?. Well I noticed that on videos like https://www.youtube.com/watch?v=v2AC41dglnM the background color seems to be transparent.

Ahh I see.

Feel free man, maybe there's a better way but well, this works ok for now :sweat_smile:

Botanمؤلف
§
Posted: 23-05-2018

Yes, it works, but I still hope Youtube will get the hands on it so this fix is no longer needed.

Post reply

تسجيل الدخول إلى مرحلة ما بعد الرد.