Play youtube videos in fullscreen auto

By Shu Last update Feb 20, 2007 — Installed 4,577 times. Daily Installs: 1, 5, 5, 4, 5, 3, 1, 4, 4, 3, 2, 0, 2, 2, 3, 3, 3, 5, 7, 3, 2, 2, 2, 6, 3, 1, 5, 2, 4, 2, 4, 2
// ==UserScript==
// @name          YouTube full screen
// @include       http://youtube.com/*
// @include       http://www.youtube.com/*
// ==/UserScript==

unsafeWindow.watchFull = watchFull;
unsafeWindow.hookLink = hookLink;
hookLink();


function hookLink(){
for(i=0;i<document.links.length;i++)
{
if(document.links[i].pathname=='/watch')
document.links[i].href='javascript:watchFull(\''+document.links[i].search+'\');';
}
setTimeout(hookLink,1000);
}

function watchFull(v)
{
xmlobj=new XMLHttpRequest();
xmlobj.open('GET','/watch'+v,false);
xmlobj.send(null);

urlstart = xmlobj.responseText.indexOf('var fs ') + 9;
urlend = xmlobj.responseText.indexOf(';',urlstart);
eval(xmlobj.responseText.substring(urlstart,urlend).replace('"FullScreenVideo"','"'+v+'"'));
}