JSONovich / jsonovich

A webextension for Firefox. Pretty-prints JSON content in the browser for easy, unobtrusive viewing.
https://addons.mozilla.org/firefox/addon/jsonovich/
Mozilla Public License 2.0
7 stars 3 forks source link

Doesn't work with VERY long lines #20

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Attempt to load up a sample json with 220,000+ characters on a single line. 
Have also seen this issue when loading the test.json 
(http://lackoftalent.org/tmp/test.json)

What is the expected output? What do you see instead?
Expected to display the JSON, nicely formatted. Instead it will only display 
the first 2500-3000 characters (on the 220,000 character file), and does not 
format it at all (prints like plain text output in the browser).

What version of the product are you using? On what operating system?
Using jsonovich 1.8.2 in Firefox 4.0.1 on Ubuntu 10.10

Please provide any additional information below.

Original issue reported on code.google.com by d...@gotdoug.com on 15 Jun 2011 at 9:14

GoogleCodeExporter commented 9 years ago
Interesting, I noticed the same thing with the linked file on a borrowed laptop 
but now I'm home I can't reproduce either with that, a 480k+ char or 570k+ char 
test file.

I think there was a message on the error console about JSON.parse but can't 
remember it exactly, if you could check your error console for anything that 
might point to the problem that'd be great. Might also be worthwhile 
reinstalling JSONovich just in case the download was corrupt.

Original comment by W.Elwoo...@gmail.com on 19 Jun 2011 at 6:55

GoogleCodeExporter commented 9 years ago
Sorry, finally had a chance to get back to this. Yes, there is an error in the 
Error Console. It says:

Error: [JSONovich Error] SyntaxError: JSON.parse
Source File: resource://gre/modules/XPIProvider.jsm -> 
jar:file:///home/user/.mozilla/firefox/i6neg6f3.default/extensions/jsonovich@lac
koftalent.org.xpi!/bootstrap.js -> 
jar:file:///home/user/.mozilla/firefox/i6neg6f3.default/extensions/jsonovich@lac
koftalent.org.xpi!/modules/gecko/jsonovich.js -> 
jar:file:///home/user/.mozilla/firefox/i6neg6f3.default/extensions/jsonovich@lac
koftalent.org.xpi!/modules/gecko/log.js
Line: 23

It is pretty consistently breaking the JSAON in the middle of plain text words 
that shouldn't be causing any parse errors.

Uninstalling it, and then installing it again from 
http://lackoftalent.org/michael/blog/json-in-firefox/ doesn't seem to make a 
difference (same error, in the same place).

If I restart the browser after re-installing the plugin (even though it says it 
isn't needed), it will load quite a bit more of the JSON output, but still 
doesn't "pretty print" it, and the output is still incomplete. But the error 
from before, seems to have stopped.

Reloading the page after this, goes back to stopping in the same place as 
before the restart. The error is still not appearing in the console.

Original comment by d...@gotdoug.com on 21 Jun 2011 at 10:49

GoogleCodeExporter commented 9 years ago
I've had another go at trying to reproduce this, still no luck in any of my 4 
Firefox or 2 SeaMonkey installations. All I can think of is that another addon 
might be interfering with the stream conversion process (which doesn't explain 
my brief encounter with the error on a clean profile).

In any case, my plan for supporting javascript mime-types in the near future 
will mean the 7-year-old stream conversion code where the error occurs gets 
phased out eventually, so I'm not too keen to dig into this very deeply.

Also, I didn't realise that link on Michael's blog pointed directly to the XPI 
in the source repo - it isn't the latest version (1.8.2) this time because I 
experimented with updating the XPI in the same commit as tagging, so it didn't 
go into trunk. It's probably unrelated, but just be aware that installing from 
that link will currently give you an older version (1.8.1).

Original comment by W.Elwoo...@gmail.com on 25 Jun 2011 at 9:52

GoogleCodeExporter commented 9 years ago
Following on from the reinstall being an older version, the logging in that 
version was all controlled by a single debug setting, so it makes sense that 
the error didn't appear in the console any more.

Original comment by W.Elwoo...@gmail.com on 25 Jun 2011 at 10:05

GoogleCodeExporter commented 9 years ago
I just had an idea to connect to the internet through an SSH tunnel like I was 
on the laptop and have managed to reproduce the problem. Maybe I won't need to 
dig too deep to fix this. :)

Original comment by W.Elwoo...@gmail.com on 25 Jun 2011 at 10:24

GoogleCodeExporter commented 9 years ago
Fixed in r106 with updated XPI in trunk so the blog link works, should be on 
AMO soon.

I'll mark this verified when you or someone else confirms the problem is gone.

Original comment by W.Elwoo...@gmail.com on 25 Jun 2011 at 11:14

GoogleCodeExporter commented 9 years ago
I just wanted to confirm, I installed 1.8.3 from 
http://lackoftalent.org/michael/blog/json-in-firefox/ (in Firefox 5 this time) 
and it is now pretty-printing the long JSON feed that we are receiving.

Thanks for the quick fix of this.

Original comment by d...@gotdoug.com on 28 Jun 2011 at 9:55

GoogleCodeExporter commented 9 years ago
Cheers for confirmation.

Original comment by W.Elwoo...@gmail.com on 29 Jun 2011 at 2:50