Snippet to copy current Youtube Video Url with Time

Quickly Copy Youtube video url with current time

While watching the current video and want to quickly get the link to current moment, it’s a bit long process to do that using YT native menu (you need to click “Share, then click “current time” checkbox and copy the selected link.

There exists a small snippet to do the work. Just select all this code and drag into your Browser’s bookmarks bar:

javascript: use_DIRECT_COPY=true; function fallbackCopyTextToClipboard(text) { var textArea = document.createElement("textarea"); textArea.value = text; textArea.style.position="fixed"; document.body.appendChild(textArea); textArea.focus(); textArea.select(); try { var successful = document.execCommand("copy"); } catch (err) { promptCopy1(text); } document.body.removeChild(textArea); } function promptCopy1(text){ prompt("url", text); }; (function(){ var yt=document.getElementById("movie_player"); var data=yt.getVideoData(); var text=data["title"] + " " + "https://youtu.be/"+data["video_id"]+"?t="+Math.floor(yt.getCurrentTime()); if (use_DIRECT_COPY) fallbackCopyTextToClipboard(text); else {promptCopy1(text);} })(); void(0);

So, when you are on Youtube video, just click that button and it will copy the link into buffer, with the title.

Leave a Comment

Your email address will not be published. Required fields are marked *

WordPress › Error

There has been a critical error on this website.

Learn more about troubleshooting WordPress.