Guest
[Entry]
"Apparently, some time ago someone asked how to build such an extension on the Chromium-extensions Google group, and the answer was that it's not yet possible.
More recently, someone else asked the same question again - so, it looks like it won't take long for such an extension to appear, as soon as API support is implemented.
Meanwhile, if you're really bothered by this and you can install a local proxy (Fiddler2, for example), you could try to make it change the Content-Type header for all responses where it is ""application/json"" to ""text/plain"" - and do it only for Chrome page requests. This will trick Chrome into showing you a plain text view of the JSON data, instead of trying to download it. Be careful, though: this could break some web applications which expect the ""application/json"" content-type.
To implement this with Fiddler, just choose ""Customize Rules"" from Fiddler's ""Rules"" menu, and when the CustomRules.js file opens, add this variable to the beginning of the Handlers class:
class Handlers { // You have to add these two lines public static RulesOption(""Show JSON data as plain text in Chrome"") var m_JSON2Text: boolean = false;
And then add, at the end of the OnBeforeResponse method, just before the closing bracket:
if(m_JSON2Text) { var isJson = oSession.oResponse[""Content-Type""].indexOf(""application/json"") != -1; var isChrome = oSession.oRequest[""User-Agent""].indexOf(""Chrome"") != -1; if(isJson && isChrome) { oSession.oResponse[""Content-Type""] = ""text/plain; ""; } } // Next is the closing bracket. Add all lines preceding this comment }
This will add an item named ""Show JSON data as plain text in Chrome"" to Fiddler's ""Rules"" menu, which you'll be able to turn on/off, triggering/disabling the required behaviour.
The overhead is having to keep Fiddler2 running while browsing. If that will or will not be noticeable depends, of course, on your hardware/software configuration."
|