is there a way to output a json in a nice way in the console? I just get "> Object" as the tree root and have to manually navigate through the tree which is annoying.
The best case would be to search for a string within that object. Alternatively expanding everything would be ok as well.
Any ideas?
(Was asked before in Is there a way in Chrome console to search for strings in console outputs, even those collapsed? but not answered)
In Google Chrome Developer Tools > Resources > XHR when I click on the resource on the left and then on the Content tab I see the JSON string as a string and not as a tree as Firebug and Firebug Lite do.
Got this from Superuser:
If the right-click -> copy is not available you could try:
1 - Right-click the object and select "Store as global variable"
2 - The console will print the new variable's name, for example:
//temp1
3 - Type:
copy(temp1)
The object is now available in your clipboard.
Tested in chrome 36
I used this in Chrome 65 and worked great.
ATM your best option is to use JSON.stringify
as explained here.
There is an DevTools Console API for Chrome extensions that allows to customize console output, but it's still experimental.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With