3gwebtrain
3gwebtrain

Reputation: 15303

What is the correct way to copy a `consoled` object in to clip board from chrome browser

In my app, i would like to send a generated json data to my client. for that I am trying to copy the object in to clip board from chrome console. In the internet i seen some guide to copy the object from console to clip board, but i didn't get any good result.

I tried like this :

 Object {Mechanical: Object, grandClipCount: 1} //consoled object
temp1
Object {Mechanical: Object, grandClipCount: 1} //stored as global veriable
copy(temp1) //coping to clip board
[object Object] // i tried to paste in to note pad, but it's not object at all..

Any one guide me the correct way please?

Upvotes: 2

Views: 104

Answers (1)

Ben Kissi
Ben Kissi

Reputation: 36

First right click on the object in the console and then select "Store as Global Variable". It will store the object in an arbitrary variable like "temp1".

Next use the browsers copy() method to copy the object to your clipboard like copy(temp1) This will return "undefined" but don't worry it has been copied. Just go and paste it.

Note: I am using chrome

Upvotes: 1

Related Questions