Bug 202933 - Web Inspector: Add copy object as JSON
Summary: Web Inspector: Add copy object as JSON
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-14 09:48 PDT by Orta Therox
Modified: 2019-10-14 10:45 PDT (History)
2 users (show)

See Also:


Attachments
example object I was trying to copy (241.47 KB, image/png)
2019-10-14 09:48 PDT, Orta Therox
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Orta Therox 2019-10-14 09:48:09 PDT
Created attachment 380887 [details]
example object I was trying to copy

It would be great to be able to easily copy the JSON of an object which was previously logged by command clicking, or by having an icon next to the file:line on a row on hover
Comment 1 Devin Rousso 2019-10-14 10:45:01 PDT
For what it's worth, you can do this via the `copy()` function that's available when evaluating from the Web Inspector Console.

Assuming your object is JSON serializable, you can `copy(object)` and a stringified (and somewhat prettified) version will be put into the system pasteboard.

If you don't have a reference to the object, you can right click on any log/result line and select "Log Value" to get a $1, $2, ... $99 reference to it.