Skip to content

Instantly share code, notes, and snippets.

@jonkpirateboy
Last active November 28, 2016 07:34
Show Gist options
  • Save jonkpirateboy/1b6e8db7e1b42799643eb893ec1dd71b to your computer and use it in GitHub Desktop.
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".
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