How to Copy Variable from Chrome Dev Tools Console

I often need to copy a variable in Chrome dev tools console to my clipboard. Fortunately, Chrome has this feature built-in using the copy() function.

  1. Save the variable or right-click an object in Chrome’s console and select Store as Global Variable from the context menu. It will return something like temp1 as the variable name.
  2. Use the copy() method, so copy(temp1) in the console should copy that object to your clipboard.


Thanks for reading. Make sure you follow me on Twitter to stay up to date on the progress of my side projects T.LYWeather Extension, and Link Shortener Extension. If you are interested in the tech I use daily, check out my uses page.  

Leave a Reply

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