Greasy Fork is available in English.

Remove youtube topbar on theater mode

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());