Created
April 29, 2012 21:08
-
-
Save bagrow/2553270 to your computer and use it in GitHub Desktop.
bookmarklet to reload youtube video at full browser width
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: | |
var youtubeid = getQueryVariable("v"); | |
if (youtubeid != undefined){ | |
window.location="http://youtube.googleapis.com/v/"+youtubeid+"&autoplay=1"; | |
} | |
function getQueryVariable(variable) { | |
/* courtesy: http://stackoverflow.com/a/1623707 */ | |
var query = window.location.search.substring(1); | |
var vars = query.split("&"); | |
for (var i=0; i < vars.length; i++) { | |
var pair = vars[i].split("="); | |
if (pair[0] == variable) { | |
return pair[1]; | |
} | |
} | |
/*alert('Query Variable ' + variable + ' not found');*/ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment