Greasy Fork is available in English.

Youtube - Wide video container

wide video container on youtube

Від 20.03.2018. Дивіться остання версія.

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

if(!!document.getElementById("early-body")) { //if old youtube
    document.getElementById("content").setAttribute("style", "width: 90%;");
} else { //new youtube
	addGlobalStyle(`
		ytd-browse > 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: 100%;
		}

		body {
			overflow-x: hidden;
		}

		#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);
}