Last active
November 28, 2016 07:34
-
-
Save jonkpirateboy/1b6e8db7e1b42799643eb893ec1dd71b to your computer and use it in GitHub Desktop.
Put the code in a browser button. If you click it when watching a YouTube-video, the video will open in a pop up. Disctraction free and perfect for watching videos while "working".
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
javascript:yturl=window.location.href;ytarr=yturl.split("?v=");ytqs=ytarr[1];ytqs=ytqs.replace("&","?");ytelem=document.getElementById("movie_player");yttime=Math.floor(ytelem.getCurrentTime());document.getElementsByTagName("video")[0].pause();if(ytqs.indexOf("?")>-1){ytqsstart="&"}else{ytqsstart="?"}window.open("https://www.youtube.com/embed/"+ytqs+ytqsstart+"autoplay=1&start="+yttime,ytqs,"width=400,height=300");void(0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment