YouTube Interface Cleaner

By JoeSimmons Last update Sep 21, 2008 — Installed 529 times.

There are 4 previous versions of this script.

// ==UserScript==
// @name           YouTube Interface Cleaner
// @namespace      http://userscripts.org/users/23652
// @description    Strips YouTube's interface down to a bare nothing and optimizes load time.
// @include        http://*youtube.com/watch?v=*
// @copyright      JoeSimmons
// ==/UserScript==

function id(ID) {
var id = document.getElementById(ID);
if(id) { return id; }
else { return false; }
}

function removeElemById(byIdE) {
var e = document.getElementById(byIdE);
if(e) {
e.parentNode.removeChild(e);
return true;
}
}

function removeElemByClass(byClassE) {
var s = '//div[@class=\''+byClassE+'\']';
var e = document.evaluate(s,document,null,6,null);
if(e) {
for(var i=0; i<e.snapshotLength; i++) {
e.snapshotItem(i).parentNode.removeChild(e.snapshotItem(i));
}
return true;
}
}

// Simple removing of the whole right section
/*
removeElemById('watch-other-vids');
removeElemById('watch-ratings-views');
removeElemById('watch-actions-area');
removeElemById('watch-comments-stats');
removeElemById('footer');
removeElemById('copyright');
removeElemById('masthead');
removeElemById('watch-active-sharing');
removeElemById('watch-video-response');
removeElemById('watch-main-area');
removeElemById('old-footer');
removeElemById('old-masthead');
removeElemByClass('links');
removeElemByClass('search');
*/
//removeElemById('baseDiv');

var wvt,mpC,toBeBody;

GM_addStyle('.center {align:center;text-align:center;padding:3em;}');

wvt = id('watch-vid-title').cloneNode(true); // Copy of the title
mpC = id('movie_player').cloneNode(true); // Copy the movie_player

document.body.innerHTML = '';

toBeBody = document.createElement('div');
toBeBody.setAttribute('id', 'base');
toBeBody.setAttribute('class', 'center');
toBeBody.appendChild(wvt);
toBeBody.appendChild(document.createElement('br'));
toBeBody.appendChild(mpC);

document.body.appendChild(toBeBody);