What happened to fomatting the JSON in the Preview tab?

10,486 views
Skip to first unread message

Philip H

unread,
Sep 20, 2017, 10:54:33 AM9/20/17
to Google Chrome Developer Tools

Hey, so in the Network tab of the Developer Tools, after selecting a network call you can use the Preview tab to preview the response. It used to format the JSON all nice and pretty so I could collapse and go through it, now its just a text blob. What happened?


Jonathan Garbee

unread,
Sep 20, 2017, 4:28:06 PM9/20/17
to Google Chrome Developer Tools
Your response header is probably a text or other non `application/json` type. Try verifying the response header instructs clients that it is in fact JSON data.

On Wed, Sep 20, 2017 at 10:54 AM, Philip H <philip...@gmail.com> wrote:

Hey, so in the Network tab of the Developer Tools, after selecting a network call you can use the Preview tab to preview the response. It used to format the JSON all nice and pretty so I could collapse and go through it, now its just a text blob. What happened?


--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-developer-tools+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chrome-developer-tools/4f85dbe2-ddbc-4179-be16-2f0f3d1134df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

RaphaelDDL

unread,
Sep 20, 2017, 6:42:32 PM9/20/17
to Google Chrome Developer Tools
I actually noticed this too.
Canary is not formatting correctly on preview tab.

The headers:
Yes, in my case the backend is returning the wrong content-type (as text/html;charset=ISO-8859-1), BUT the thing is, in Stable Chrome, it renders as an object in Preview, independent of the content-type (auto-detect?):


On the other hand, Chrome Canary is loading as plain text:

Since was working and now is broken, I guess it's a bug, no?

Philip H

unread,
Sep 20, 2017, 6:44:14 PM9/20/17
to Google Chrome Developer Tools
I feel like it should auto-detect either way but I can add that header to my response if I have to get it to work.

Blaise Bruer

unread,
Sep 20, 2017, 8:45:12 PM9/20/17
to Google Chrome Developer Tools
The preview panel will try and parse the JSON and if successful will show the JSON view. It is likely a bug. Please file a bug at http://crbug.com/

Thanks!

--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chrome-developer-tools/3b25c8a4-96a3-4bf4-b704-dc5aca289bb5%40googlegroups.com.

Philip H

unread,
Sep 21, 2017, 7:55:09 AM9/21/17
to Google Chrome Developer Tools


On Wednesday, September 20, 2017 at 7:54:33 AM UTC-7, Philip H wrote:

Bryan Buchan

unread,
Sep 26, 2017, 3:00:41 AM9/26/17
to Google Chrome Developer Tools
Having the same issue. Quite frustrating. It appears to work on some returns but not others. I confirmed the response headers are not just text type on both. I rely on this formatting heavily.

Ariel Coyant

unread,
Oct 2, 2017, 12:58:55 PM10/2/17
to Google Chrome Developer Tools
Hi, found the same issue and fixed setting in php response the next header: header('Content-Type: application/json');

Larry LACa

unread,
Oct 2, 2017, 1:32:02 PM10/2/17
to Google Chrome Developer Tools
Per CR 767393, auto detect for JSON in text/html is being restored.  The fix should be available in Canary (v63) and soon in Dev.  The fix may have missed the cutoff date for merge into v62 Beta. See CR 767393 for progress/status.

As a workaround you can try: header('Content-Type: application/json'); as mentioned above and in the CR.


chira...@gmail.com

unread,
Dec 14, 2017, 2:27:05 AM12/14/17
to Google Chrome Developer Tools


Hi Larry,

this bug is still there in current version(63.0.3239.84).
Reply all
Reply to author
Forward
0 new messages