Omar Omar - 5 months ago 40
Javascript Question

Copy value to clipboard via Javascript command inserted in Address Bar

I'm able to get the current time of a Youtube playing video via inserting this JavaScript command to the address bar:


What I'm looking for is to get this video current time value to clipboard instead of displaying it within an alert box.

I'm using Chrome.


Copying to clipboard is easiest done using a lightweight open-source Javascript library. clipboard.js and clipboard-js both work in my experience.