// ==UserScript== // @name u-Youtube // @name:zh-CN 功夫制霸YouTube // @name:zh-TW 功夫製霸YouTube // @name:en u-Youtube // @name:ua u-Youtube // @name:ja カンフー支配YouTube // @name:ko 쿵푸 지배YouTube // @name:it u-Youtube // @name:de u-Youtube // @name:fr u-Youtube // @namespace https://github.com/rasso1/u-Youtube // @version 1.42 // @description make Youtube under ur control // @description:zh-TW make Youtube under ur control // @description:en make Youtube under ur control // @description:ja あなたのコントロール下でYouTubeを作る // @description:ko 유튜브를 당신의 통제하에 두십시오 // @description:it rendi youtube sotto il tuo controllo // @description:de Machen Sie YouTube unter Ihrer Kontrolle // @description:fr faire de youtube sous votre contrôle // @author ok! // @match https://www.youtube.com/* // @match https://youtube.com/* // @run-at document-start // @downloadURL none // ==/UserScript== (function() { 'use strict'; var expand_description = 1;var subscription_up = 1; var sec_sub,sec_fwd,wheel_sec,buffer_time,dark_mode,video_speed,video_quality,english_mode,comment_right,temp_buffer,temp_speed,speed_display,current_time,doc_s,icare_mode,ytplay_bezel; var inner_hight=window.innerHeight-parseInt(window.innerHeight/7); var inner_width=window.innerWidth*0.34; //var inner_hight=500; var youtube_hand = { message_box: { show: function(message) { clearTimeout(ytplay_bezel); document.querySelector("#container > #movie_player .ytp-bezel-text").innerHTML = message; document.querySelector("#container > #movie_player .ytp-bezel-text").parentNode.parentNode.style.display = ""; document.querySelector("#container > #movie_player .ytp-bezel-text").parentNode.parentNode.classList.remove("ytp-bezel-text-hide"); ytplay_bezel = setTimeout(youtube_hand.message_box.hide, 2500); }, hide: function() { document.querySelector("#container > #movie_player .ytp-bezel-text").innerText = ""; document.querySelector("#container > #movie_player .ytp-bezel-text").parentNode.parentNode.style.display = "none"; } }, dark_eye:function (){ if(localStorage.getItem('icare_mode')==1){ document.querySelector("html").style="font-size:13px;font-family: Roboto, Arial, sans-serif;" } else {document.querySelector("html").style="font-size:10px;font-family: Roboto, Arial, sans-serif;"} if(localStorage.getItem('dark_mode')==1){ if(!document.querySelector("html").hasAttribute("dark")){ document.querySelector("html").setAttribute("dark",true);} } else if(document.querySelector("html").hasAttribute("dark")) {document.querySelector("html").removeAttribute("dark")} if(localStorage.getItem("comment_right")==1&&document.querySelector("#columns #primary #primary-inner #sections")&&document.querySelector("#secondary #secondary-inner")){ //评论右上移 document.querySelector("#columns #primary #primary-inner #sections").style="width:"+inner_width+"px;height:"+inner_hight+"px;overflow-y:auto"; document.querySelector("#columns #primary #primary-inner #sections").classList.add('standardized-themed-scrollbar'); // document.querySelector("#columns #primary #primary-inner #sections") document.querySelector("#secondary #secondary-inner").append(document.querySelector("#columns #primary #primary-inner #sections")); document.querySelector("#page-manager #columns > #secondary > #secondary-inner > #sections").onscroll=function(){ document.querySelector("body").style.overflow="hidden"; } document.querySelector("#page-manager #columns > #secondary > #secondary-inner > #sections").onpointerleave=function(){ document.querySelector("body").style.overflow=""; } /* document.querySelector("#page-manager #columns > #secondary > #secondary-inner > #sections").onscroll=function(){ let comment_height= parseInt(document.querySelector("#page-manager #columns > #secondary > #secondary-inner > #sections").style.height); comment_height+=1; document.querySelector("#page-manager #columns > #secondary > #secondary-inner > #sections").style.height = comment_height+"px"; document.querySelector("#page-manager #columns > #secondary > #secondary-inner > #sections").style.float="right"; }; */ //related 左下移 document.querySelector("#columns #primary #primary-inner").append(document.querySelector("#secondary #secondary-inner #related")); } // else if(document.querySelector("yt-live-chat-app")){document.querySelector("#secondary #secondary-inner").append(document.querySelector("yt-live-chat-app"))} }, dark_eye1:function (){ if(localStorage.getItem('dark_mode')==1){ var style_type = document.createElement("style");style_type.id = "style_type"; style_type.innerHTML = `#end > div.dropdown-hover > div{font-size:12px;color:#bbb !important;background-color:#202020 !important;} #end > div.dropdown-hover > button{background-color:#222 !important;} #end > div.dropdown-hover path{fill:transparent !important;stroke:white !important;} #end > div.dropdown-hover > div > div{color:#aaa !important;background-color:#202020 !important;} #end > div.dropdown-hover > div > div p{font-size:12px;color:#bbb !important;background-color:#202020 !important;} .dropdown-hover button div{font-size:12px;color:#aaa !important;background-color:#333 !important;} #sec_sub,#sec_fwd,#wheel_sec,#buffer_time{font-size:12px;color:#bbb !important;background-color:#333 !important;border-radius:5px;}`; document.head.appendChild(style_type); } }, //播放设置 play_menu:function(){ var html_app = document.createElement("div"); html_app.innerHTML = `