Make JSON bookmarks nominally human-readable

Bug #301578 reported by era
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mozilla Firefox
Won't Fix
Low
firefox-3.0 (Ubuntu)
Won't Fix
Wishlist
Unassigned

Bug Description

Binary package hint: firefox

Opening the bookmarks in file:///home/you/.mozilla/firefox/v3r1s3kr3t.default/bookmarkbackups/bookmarks-2008-11-20.json in the browser shows the beginning a single long line and a horizontal scroll bar. It would be nice if this could be displayed in a somewhat more human-readable format for quick inspection. I believe the JSON format should have some tolerance for adding newlines and indentation in order to make it palatable for humans.

Steps to repro:

1. In the location bar, type in file:///home and navigate to your own home directory, its .mozilla subdirectory, the firefox subdirectory within that, the subdirectory for your profile (usually with .default at the end of the name) and finally the bookmarkbackups subdirectory within that.
2. Click on one of the files.
3. Try to read it.

Expected outcome:

Easily see the structure of the file, find the JavaScript code for a particular complex bookmarklet, search for a particular keyword to see whether it's already in use, etc.

I don't expect a full-fledged browser for this format (that would be nice too, of course, but it's clearly something one could write an extension for, rather than bloat the default Firefox code base with), I just want the on-disk JSON to have some newlines and indentation to make it somewhat human-readable.

Actual outcome:

A long line, from which the following is visible:

{"title":"","id":1,"dateAdded":1226491072760742,"lastModified":1226645650728289,"type":"text/x-moz-place-container",

Horizontal scroll bar, very coarse, easily scrolls more than a screenful per pixel once the line grows long enough.

Revision history for this message
John Vivirito (gnomefreak) wrote :

The clear text version of your bookmarks are the .html file. I made it Firefox-3.0 bug and added wishlist. Can you please file this bug upstream and post this link to this bug report so we can track it.

Changed in firefox-3.0 (Ubuntu):
importance: Undecided → Wishlist
status: New → Incomplete
Revision history for this message
era (era) wrote :

FWIW I don't see stuff I added recently to my bookmarks toolbar in the bookmarks.html file. I'm not sure under what circumstances it gets updated, but stuff I added there yesterday is not yet there today. Yesterday's bookmarkbackups JSON file seems to be up to date. Is this a bug or something?

Revision history for this message
In , Era+mozilla (era+mozilla) wrote :

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.8) Gecko/2009032711 Ubuntu/8.10 (intrepid) Firefox/3.0.8
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.8) Gecko/2009032711 Ubuntu/8.10 (intrepid) Firefox/3.0.8

Forwarded from https://bugs.launchpad.net/ubuntu/+source/firefox-3.0/+bug/301578

Opening the bookmark backups in file:///home/you/.mozilla/firefox/v3r1s3kr3t.default/bookmarkbackups/bookmarks-2008-11-20.json in the browser shows the beginning a single long line and a horizontal scroll bar. It would be nice if this could be displayed in a somewhat more human-readable format for quick inspection. I believe the JSON format should have some tolerance for adding newlines and indentation in order to make it palatable for humans.

Reproducible: Always

Steps to Reproduce:
1. In the location bar, type in file:///home and navigate to your own home directory, its .mozilla subdirectory, the firefox subdirectory within that, the subdirectory for your profile (usually with .default at the end of the name) and finally the bookmarkbackups subdirectory within that.
2. Click on one of the files.
3. Try to read it.

Actual Results:
A long line, from which the following is visible:

{"title":"","id":1,"dateAdded":1226491072760742,"lastModified":1226645650728289,"type":"text/x-moz-place-container",

Horizontal scroll bar, very coarse, easily scrolls more than a screenful per pixel once the line grows long enough.

Expected Results:
Easily see the structure of the file, find the JavaScript code for a particular complex bookmarklet, search for a particular keyword to see whether it's already in use, etc.

I don't expect a full-fledged browser for this format (that would be nice too, of course, but it's clearly something one could write an extension for, rather than bloat the default Firefox code base with), I just want the on-disk JSON to have some newlines and indentation to make it somewhat human-readable.

I am the original submitter of the Ubuntu bug.

Changed in firefox:
status: Unknown → New
Revision history for this message
In , Mak77 (mak77) wrote :

json format is not intended for human comprehension nor manual use.
that said, this should at last be supported by the browser as a supported and parsable format, btw not sure if this is something that'd be good as a core browser feature rather than an add-on.

Revision history for this message
In , Era+mozilla (era+mozilla) wrote :

I'm looking for a really minimal fix, like a pair of newlines around each complex internal node in the tree. This is decidedly a secondary or even tertiary use case, but if esoteric cases can be supported with a very trivial fix, I'm hoping it could be accepted.

Revision history for this message
In , daviddahl (ddahl) wrote :

Actually: according to the JSON.org website: "JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write." http://www.json.org/

I have always thought that one of JSON's best features was human readability.

Just a thought.

Revision history for this message
In , Mak77 (mak77) wrote :

yes but internet is plenty of json parsers that exactly format json strings in a readable format. So again i'm not sure Firefox should include a json formatter in its core features. And our json is created through native json methods.

you probably can take a look at JSONView add-on: https://addons.mozilla.org/en-US/firefox/addon/10869

Revision history for this message
In , Dietrich-mozilla (dietrich-mozilla) wrote :

External JSON viewers and development tools are sufficient, this doesn't need to be fixed in core. -> WONTFIX.

Changed in firefox:
status: New → Won't Fix
Revision history for this message
John Vivirito (gnomefreak) wrote :

As upstream as decided they will not add this feature to core code and we will not add it on our end.
Here is something to look into using:
https://addons.mozilla.org/en-US/firefox/addon/10869

the reason stated for the wont fix upstream is because there are many options for this outside of core code.

Changed in firefox-3.0 (Ubuntu):
status: Incomplete → Won't Fix
Changed in firefox:
importance: Unknown → Low
Revision history for this message
In , Dimitrios Apostolou (jimis) wrote :

You are dismissing one primary advantage of serialising in JSON: human readability.

I understand you might not be interested but are you opposed? I.e. will you accept a patch that adds some newlines and tabs?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.