wide video container on youtube
目前為
// ==UserScript==
// @name Youtube - Wide video container
// @namespace 1N07
// @author 1N07
// @description wide video container on youtube
// @include https://www.youtube.com/*
// @version 1.6.1
// @grant none
// ==/UserScript==
if(!!document.getElementById("early-body")) { //if old youtube
document.getElementById("content").setAttribute("style", "width: 99%;");
} else { //new youtube
addGlobalStyle(`
#page-manager > ytd-browse:not([page-subtype="playlist"]) ytd-two-column-browse-results-renderer.ytd-browse,
ytd-browse ytd-video-masthead-ad-v3-renderer.ytd-browse
{
box-sizing: border-box;
width: 99%;
width: calc(100% - 20px) !important;
position: relative !important;
}
`);
}
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);
}