Youtube - Wide video container

wide video container on youtube

Verze ze dne 11. 07. 2018. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name        Youtube - Wide video container
// @namespace   1N07
// @author      1N07
// @description wide video container on youtube
// @include     https://www.youtube.com/*
// @version     1.5
// @grant       none
// ==/UserScript==

if(!!document.getElementById("early-body")) { //if old youtube
    document.getElementById("content").setAttribute("style", "width: 99%;");
} else { //new youtube
	addGlobalStyle(`
		ytd-browse:not([guide-persistent-and-visible]) > ytd-two-column-browse-results-renderer.style-scope.ytd-browse {
			position: relative;
			left: 1%;
			width: 100%;
		}

        ytd-browse[guide-persistent-and-visible] > ytd-two-column-browse-results-renderer.style-scope.ytd-browse {
			position: relative;
			left: -4%;
			width: 90%;
		}

		#title-container > #spacer {
			display: none;
		}

		#content > #page-manager {
			width: 99%;
		}

		body {
			overflow-x: hidden;
		}

		ytd-channel-sub-menu-renderer > #sort-menu {
			position: relative;
			right: 7%;
		}
	`);
}

function addGlobalStyle(css) {
    var head, style;
    head = document.getElementsByTagName('head')[0];
    if (!head) { return; }
    style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = css;
    head.appendChild(style);
}