litejs / json-lite

Fast non-blocking JSON viewer for Chrome and Firefox
195 stars 16 forks source link

Formatting does not always work #37

Closed epaaj closed 5 years ago

epaaj commented 5 years ago

JSON documents aren't always formatted but instead displayed as text. Sometimes I get json formatting on the first or second load of the page but if I reload it stops formatting the json code and it won't format it again when reloading. It feels very random and sometimes it works just fine.

Firefox 62.0.3 (64-bit) json-lite v18.10.0

lauriro commented 5 years ago

Any error in console? Is it related only to https sites? Is there any public example where formatting sometimes fails? Any other extensions enabled? (try to disable other not-related extensions and try then)

epaaj commented 5 years ago

No error in console. Same for http and https. I get the issue with this document: https://jsonplaceholder.typicode.com/photos Although it seems to be more frequent with more complex documents. I have a handful of other extensions enabled. I can try to disable them and see what happens.

If it matters I run Arch Linux.

epaaj commented 5 years ago

It seems I only get the issue when I enable Tridactyl (https://github.com/tridactyl/tridactyl) I guess that could make sense. But I would understand it better if it would always fail. Not this randomness I get where it works sometimes by just pressing F5.

lauriro commented 5 years ago

Probably it fails only sometimes because tridactyl handles quick loading pages differently.

I have an idea how to improve json-lite behaviour in similar race conditions, will try it out in couple of days.

epaaj commented 5 years ago

Interesting. I'll try it out when you have something. Thanks!

lauriro commented 5 years ago

Could you try a git version?

git clone git@github.com:lauriro/json-lite.git
cd json-lite
make firefox

In firefox go to url about:debugging#addons, click Load Temporary Add-on… and find manifest.json in json-lite folder

epaaj commented 5 years ago

I'm sorry but I won't be able to test this until next week probably. I'll return with test results asap though.

epaaj commented 5 years ago

I just tried the latest git version and it seems to be working very nicely. Tried switching back to the current version and then back to git version and the git version works every time I load a page so far. Thanks!

lauriro commented 5 years ago

released in version 18.12.0