Skip to content

Instantly share code, notes, and snippets.

@bagrow
Created April 29, 2012 21:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bagrow/2553270 to your computer and use it in GitHub Desktop.
Save bagrow/2553270 to your computer and use it in GitHub Desktop.
bookmarklet to reload youtube video at full browser width
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