Created
August 14, 2015 14:11
-
-
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)
This file contains 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
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