Skip to content

Instantly share code, notes, and snippets.

@Flygenring
Created August 14, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Flygenring/ebf49cf6c7e7f169fbc2 to your computer and use it in GitHub Desktop.
Save Flygenring/ebf49cf6c7e7f169fbc2 to your computer and use it in GitHub Desktop.
Script for a slightly improved full screen YouTube (prefix with 'javascript:' and it works as a magical bookmarklet)
url = window.location.href.replace(/(>|<)/gi,'').split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/); if(url[2] !== undefined) { id = url[2].split(/[^0-9a-z_\-]/i)[0]; el = document.getElementsByTagName('html')[0]; el.style.height = "100%"; el.innerHTML = '<body style="width:100%;height:100%;padding:0;margin:0;"><iframe width="100%" height="100%" src="https://www.youtube.com/embed/' + id + '" frameborder="0" allowfullscreen></iframe></body>'; } else { alert('No video was found'); }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment