I keep trying to get this to work, but for some reason I cannot. I would very much appreciate it if someone could tell me what's wrong with this thing.


Engines.js

chrome.browserAction.onClicked.addListener(function(tab) {
Start()
}):


var video_id=null;
var video_hash=null;
var video_player=document.getElementById('movie_player');

function Start()

{if(video_player)
{
var flash_variables=video_player.attributes.getNamedItem('flashvars');
if(flash_variables) {
var flash_values=flash_variables.value;
if(flash_values)
{
var video_id_match=flash_values.match(/[^a-z]video_id=([^(\&|$)]*)/);
if(video_id_match!=null)video_id=video_id_match[1];var video_hash_match=flash_values.match(/[^a-z]t=([^(\&|$)]*)/);
if(video_hash_match!=null)video_hash=video_hash_match[1]
}
}
}

if(video_id==null||video_hash==null)
{
var args=null;
try {
args=yt.getConfig('SWF_ARGS')}catch(e){}

if(args) {
video_id=args['video_id'];
video_hash=args['t']
}
}

if(video_id!=null&&video_hash!=null)
{
var fmt='18';
try {
if(yt.getConfig('IS_HD_AVAILABLE'))fmt='22'
}
catch(e){}
if(!document.getElementById('download-youtube-video'))
{
var yt_mp4_path='http://www.youtube.com/get_video?fmt='+fmt+'&video_id='+video_id+'&t='+video_hash;
var div_embed=document.getElementById('watch-embed-div');

if(div_embed)
{
var div_download=document.createElement('div');
div_download.innerHTML='<br /> <span id=\'download-youtube-video\'> <a href=\''+yt_mp4_path+'\' onclick=\'blur(this);
\'>Download as MP4</a></span>';
div_embed.appendChild(div_download);
}
if(navigator.appName!='Microsoft Internet Explorer')
{
document.location.href='http://www.youtube.com/get_video?fmt='+fmt+'&video_id='+video_id+'&t='+video_hash
}}}void(0);}


Manifest.json

{
"content_scripts": [ {
"js": [ "Engines.js" ],
"matches": [ "http://youtube.com/*", "http://*.youtube.com/*" ]
} ],
"description": "Downloads the highest quality version of any YouTube video.",
"icons": {
"128": "youtube128.png",
"32": "youtube32.png",
"48": "youtube48.png"
},
"browser_action": {
"default_icon": "icon19.png"
},
"key": "112358132134",
"name": "YouTube Downloader",
"permissions": [ "http://youtube.com/*", "http://*.youtube.com/*" ],
"version": "1.0"
}