Skip to content

Instantly share code, notes, and snippets.

@LoLei
Created December 16, 2022 15:29
Show Gist options
  • Select an option

  • Save LoLei/08e38967dc50d82f69eb50a96bdea2a0 to your computer and use it in GitHub Desktop.

Select an option

Save LoLei/08e38967dc50d82f69eb50a96bdea2a0 to your computer and use it in GitHub Desktop.
Make the YT video player theather mode after 5 seconds, if it is not already
// ==UserScript==
// @name YouTube Auto Theater Mode
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Make the YT video player theather mode after 5 seconds, if it is not already
// @author Lorenz Leitner
// @match https://www.youtube.com/watch?v=**
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @grant none
// ==/UserScript==
// Since for some reason after the latest YouTube UI change the theater mode setting is not saved for me...
(function() {
'use strict';
setTimeout(() => {
const tBtnCollection = document.getElementsByClassName("ytp-size-button");
const tBtn = tBtnCollection[0];
if(tBtn.title.includes("Theater")) {
tBtn.click();
}
}, 5000);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment