Seems to me you found the bug here: the proxy is failing. If the
server says "application/json" but the response is not parseable as
jSON, the Firebug should show the unparsed raw response and an
indication that it is not JSON. (I suppose if this proxy becomes
widely used it will change the meaning of "application/json" de facto,
so then we'd have to also parse it.)

jjb

On Mar 4, 8:15 am, Greg Tidwell <[email protected]> wrote:
> Hello Jan,
>
> The content-type is application/json, but the proxy is altering the
> response body such that it cannot be converted to an object by
> parseJSONString.
>
> So, I ended up editing the parseJSON function in jsonViewer.js to
> handle iGoogle json responses differently.
>
> Other than hacking firebug's code or writing my own extension, is
> there another way to do this?
>
> Thanks for your response and your awesome tutorials.
>
> On Mar 2, 11:47 am, Jan Odvarko <[email protected]> wrote:
>
> > Hi Greg,
> > I think that one problem could be also wrong content-type.
> > Currently, Firebug is trying to parse only following content-types:
> > "application/json"
> > "text/plain"
> > "text/x-json"
> > "text/x-json"
>
> > There is also a bug forJSONtab enhancements 
> > here:http://code.google.com/p/fbug/issues/detail?id=1398
>
> > Anyway, do you have an online test-case that I could try?
>
> > > To get thejsonexplorer working with iGoogle, I think I need to write
> > > a custom parseJSONString function. This is my first time looking into
> > > the internals of firebug and would appreciate any advice.
>
> >https://developer.mozilla.org/en/FirebugInternalshttp://www.softwarei...
>
> > If you want to see how the parsing is done now, see jsonViewer.js
> > file
> > within Firebug.
>
> > Honza
>
> > On 2 Bře, 02:20, Greg Tidwell <[email protected]> wrote:
>
> > > I'd love to be able to use theJSONExplorer when developing iGoogle
> > > Gadgets rather than littering my code with console.log(eval('(' + resp
> > > + ')'));
>
> > > However, Google's proxy alters the actual response into a string that
> > > thejsonexplorer ignores.
>
> > > Actual Response:
> > > {"obj":{
> > > "first_property":"first_value"
> > > ,"second_property":"second_value"
>
> > > }
>
> > > What Firebug gets from Google Proxy:
> > > throw 1; < don't be evil' >{ 'http://example.com/api.php?
> > > format=json' : { 'body': '{\x22obj\x22:{\r\n\x22first_property
> > > \x22:\x22first_value\x22\r\n,\x22second_property\x22:\x22second_value
> > > \x22\r\n}', 'rc': 200 } }
>
> > > To get thejsonexplorer working with iGoogle, I think I need to write
> > > a custom parseJSONString function. This is my first time looking into
> > > the internals of firebug and would appreciate any advice.
>
> > > Also, anybody know why eval'ing a response like this still works as
> > > normal?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Firebug" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/firebug?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to