您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Removes the youtube topbar when theater mode is on
- // ==UserScript==
- // @name Remove youtube topbar on theater mode
- // @description Removes the youtube topbar when theater mode is on
- // @namespace nah
- // @include https://www.youtube.com/watch?*
- // @version 1
- // @grant none
- // @run-at document-end
- // ==/UserScript==
- var mainPage = document.getElementById("page");
- var stageModeButton = document.getElementsByClassName("ytp-size-button ytp-button")[0];
- var topBar = document.getElementById("masthead-positioner");
- var topBarHeightOffest = document.getElementById("masthead-positioner-height-offset");
- function isStageMode() {
- return mainPage.classList.contains("watch-stage-mode");
- }
- function toggleMe(element, show){
- if(element){
- if(show)
- element.style.visibility = "visible";
- else
- element.style.visibility = "collapse";
- }
- }
- function refreshTopBar(show){
- toggleMe(topBar, show);
- toggleMe(topBarHeightOffest, show);
- if(show)
- topBarHeightOffest.style.height = "50px";
- else
- topBarHeightOffest.style.height = "0px";
- }
- document.getElementsByClassName("ytp-size-button ytp-button")[0].onclick = function(){
- refreshTopBar(isStageMode());
- }
- refreshTopBar(!isStageMode());