Last active
August 29, 2015 13:57
-
-
Save dux/9747541 to your computer and use it in GitHub Desktop.
Expand YouTube video to full screen - bookmarklet
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
// GOOD bookmarklet, copy and paste | |
javascript:elms=['masthead-positioner-height-offset', 'content', 'footer-container', 'masthead-positioner'];for (i in elms) { var e=document.getElementById(elms[i]); if (e) e.parentNode.removeChild(e); };document.getElementById('player-api').setAttribute('class','player-api');window.exTFS=function(){ s = document.body.clientHeight-1; document.getElementById('player-api').setAttribute('style','position:absolute;top:0px; left:0px; width:100%; min-height:'+s+'px;z-index:100000000000');document.getElementById('movie_player').setAttribute('style','min-height:'+s+'px;');void(document.getElementsByTagName('video')[0].setAttribute('style','width:100%;min-height:'+s+'px;'))};window.onresize=exTFS;exTFS(); | |
// annotated source | |
elms=['masthead-positioner-height-offset', 'content', 'footer-container', 'masthead-positioner']; | |
for (i in elms) { var e=document.getElementById(elms[i]); if (e) e.parentNode.removeChild(e); } | |
document.getElementById('player-api').setAttribute('class','player-api'); | |
window.exTFS=function(){ | |
s = document.body.clientHeight-1; | |
document.getElementById('player-api').setAttribute('style','position:absolute;top:0px; left:0px; width:100%; min-height:'+s+'px;z-index:100000000000'); | |
document.getElementById('movie_player').setAttribute('style','min-height:'+s+'px;'); | |
void(document.getElementsByTagName('video')[0].setAttribute('style','width:100%;min-height:'+s+'px;')) | |
} | |
window.onresize=exTFS; | |
exTFS(); | |
// shitty bookmarklet , opens video in new page, refreshes screen, avoid | |
javascript:/v=([\w_\-]+)/.test(location.search);location.href='http://youtube.com/v/'+RegExp.$1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment