Skip to content

Viewing JSON in IE9

April 6, 2011

So far the official release of Internet Explorer 9 is quite nice. It’s noticeably faster than previous versions of IE, and the UI is pleasant enough. I happened upon a few minor annoyances with the early beta versions of IE9 (slow loading, pages unable to be rendered correctly), but it appears all those issues were ironed out.

Despite that, I still prefer Firefox due to the cornucopia of useful plugin extensions. However sometimes I still use IE9, such as at work where it’s essentially required to use Windows login authentication on intranet pages. But I also use it when debugging web pages or services I’ve developed in Visual Studio. VS will launch an instance of IE that is tracked by the debugger, so it’s easier to use that than to switch browsers.

A problem with debugging web services is that IE doesn’t know how to handle JSON. If it receives a JSON response it will prompt to save it to a file. Finally fed up with this, I looked for a plug-in that can do what JSONView does for Firefox. Instead I came across this blog post by Rick Strahl that describes a solution: adding a MIME type to the Windows registry so that JSON is treated as text. It’s not as nice as JSONView, which also prettifies the format, but it works.

Below are the steps you need to do this (that I copied verbatim from the page). Check out that page for the full details (and a nice screenshot). In fact, check out his whole blog; a lot of Rick’s articles on WCF have saved me lots of time and trouble.

Create a new application/json key in:

  • HKEY_CLASSES_ROOT\MIME\Database\ContentType\application/json
  • Add a string value of CLSID with a value of {25336920-03F9-11cf-8FD0-00AA00686F13}
  • Add a DWORD value of Encoding with a value of 80000

(The second step is quite obvious, don’t you think?)

One Comment leave one →
  1. Dmitriy permalink
    July 1, 2011 10:22 AM

    Thanx alot man!!!

Leave a Reply

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