Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I found the answer. </p> <p>You can configure IE8 to display application/json in the browser window by updating the registry. There's no need for an external tool. I haven't tested this broadly, but it works with IE8 on Vista. </p> <p>To use this, remember, all the usual caveats about updating the registry apply. Stop IE. Then, cut and paste the following into a file, by the name of <code>json-ie.reg</code>. </p> <pre><code>Windows Registry Editor Version 5.00 ; ; Tell IE to open JSON documents in the browser. ; 25336920-03F9-11cf-8FD0-00AA00686F13 is the CLSID for the "Browse in place" . ; [HKEY_CLASSES_ROOT\MIME\Database\Content Type\application/json] "CLSID"="{25336920-03F9-11cf-8FD0-00AA00686F13}" "Encoding"=hex:08,00,00,00 [HKEY_CLASSES_ROOT\MIME\Database\Content Type\text/json] "CLSID"="{25336920-03F9-11cf-8FD0-00AA00686F13}" "Encoding"=hex:08,00,00,00 </code></pre> <p>Then double-click the .reg file. Restart IE. The new behavior you get when tickling a URL that returns a doc with <code>Content-Type: application/json</code> or <code>Content-Type: text/json</code> is like this: </p> <p><img src="https://i.stack.imgur.com/JTIAD.png" alt="alt text"></p> <p>What it does, why it works: </p> <p>The <code>25336920-03F9-11cf-8FD0-00AA00686F13</code> is the CLSID for the "Browse in place" action. Basically this registry entry is telling IE that for docs that have a mime type of application/json, just view it in place. This won't affect any application/json documents downloaded via <code>&lt;script&gt;</code> tags, or via XHR, and so on. </p> <p>The CLSID and Encoding keys get the same values used for <code>image/gif</code>, <code>image/jpeg</code>, and <code>text/html</code>. </p> <p>This hint came from <a href="http://adallow.wordpress.com/2008/10/13/viewing-applicationjson-mime-type-docs-in-your-browser/" rel="noreferrer">this site</a>, and from Microsoft's article <a href="http://msdn.microsoft.com/en-us/library/ms775148(VS.85).aspx" rel="noreferrer">Handling MIME Types in Internet Explorer</a> . </p> <hr> <p>In FF, you don't need an external add-on either. You can just use the <code>view-source:</code> pseudo-protocol. Enter a URL like this into the address bar: </p> <pre><code>view-source:http://myserver/MyUrl/That/emits/Application/json </code></pre> <p>This pseudo-protocol used to be supported in IE, also, until WinXP-sp2, when Microsoft disabled it for security reasons. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload