Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

Om de ûnderfining foar jo te ferbetterjen is tydlik de funksjonaliteit dan dizze website troch ûnderhâldswurk beheind. Wannear in artikel jo probleem net oplost en jo in fraach stelle wolle, kin ús stipemienskip jo helpe yn @FirefoxSupport op Twitter en /r/firefox op Reddit.

Sykje yn Support

Mij stipescams. Wy sille jo nea freegje in telefoannûmer te beljen, der in sms nei ta te stjoeren of persoanlike gegevens te dielen. Meld fertochte aktiviteit mei de opsje ‘Misbrûk melde’.

Mear ynfo

Dizze konversaasje is argivearre. Stel in nije fraach as jo help nedich hawwe.

Internal structure / specification of JSON bookmarks backup file

  • 5 antwurd
  • 1 hat dit probleem
  • 1 werjefte
  • Lêste antwurd fan cor-el

more options

My current version of Firefox is 28.0.

What I already know is: - that bookmark backup files (JSON) are stored in folder "...\Mozilla\Firefox\Profiles\<xxxxx>.default\bookmarkbackups in files like e.g. bookmarks-2014-04-27_770.json (or in any other place when you backup manually).

- that bookmark export files are stored in any place as HTML (XML) in the Netscape bookmark format on your request to export.

- the main difference between these two formats is that in the HTML export file ONLY BOOKMARKS (URLs / URIs) and NO TAGS are stored.

- the JSON backup file stores bookmarks (URIs), tags and the complete tree structure. So Firefox is able to reconstruct the complete bookmark menu with all its information.

I am doing a lot of info research in the internet. To support a sophisticated work with hundreds or even thousands of collected boomarks tags are absolutely necessary. And I have often export bookmarks with tags to other browsers or social bookmark sites. So I have no idea why firefox does not support tags in export files - since a large amount of bookmarks without tags is not manageable.

My idea is to program a tool or an extension that reads a JSON backup file and constructs a HTML export file which also contains tags.

The problem is that the internal structure of the JSON backup file is rather complex. Actually it contains "id", "index", "parent" information (all numeric) which makes it possible to reconstruct the original tree structure. Even information on tags is somehow linked to the bookmarks. Actually the file has a complicated structure of lists and trees. And don't think that there are any identifier, e.g. "tags" which precedes a list of tags attached to a bookmark (like in HTML exports). Actually I could identify some of my tags in the file, but they are not named e.g. with "tag" - I could identify them because I knew that they are some of my defined tags, but a program doesn't have this information and needs a general way to identify tags in the file. Currently I don't know any way to do this!

Is there anybody who has a better understanding of the structur of this file or know a specification that could be find somewhere? So many thans in advance ...

My current version of Firefox is 28.0. What I already know is: - that bookmark backup files (JSON) are stored in folder "...\Mozilla\Firefox\Profiles\<xxxxx>.default\bookmarkbackups in files like e.g. bookmarks-2014-04-27_770.json (or in any other place when you backup manually). - that bookmark export files are stored in any place as HTML (XML) in the Netscape bookmark format on your request to export. - the main difference between these two formats is that in the HTML export file ONLY BOOKMARKS (URLs / URIs) and NO TAGS are stored. - the JSON backup file stores bookmarks (URIs), tags and the complete tree structure. So Firefox is able to reconstruct the complete bookmark menu with all its information. I am doing a lot of info research in the internet. To support a sophisticated work with hundreds or even thousands of collected boomarks tags are absolutely necessary. And I have often export bookmarks with tags to other browsers or social bookmark sites. So I have no idea why firefox does not support tags in export files - since a large amount of bookmarks without tags is not manageable. My idea is to program a tool or an extension that reads a JSON backup file and constructs a HTML export file which also contains tags. The problem is that the internal structure of the JSON backup file is rather complex. Actually it contains "id", "index", "parent" information (all numeric) which makes it possible to reconstruct the original tree structure. Even information on tags is somehow linked to the bookmarks. Actually the file has a complicated structure of lists and trees. And don't think that there are any identifier, e.g. "tags" which precedes a list of tags attached to a bookmark (like in HTML exports). Actually I could identify some of my tags in the file, but they are not named e.g. with "tag" - I could identify them because I knew that they are some of my defined tags, but a program doesn't have this information and needs a general way to identify tags in the file. Currently I don't know any way to do this! Is there anybody who has a better understanding of the structur of this file or know a specification that could be find somewhere? So many thans in advance ...

Bewurke troch FrankR2014 op

Keazen oplossing

Tags basically have this structure if you search the bookmarks JSON backup for tags:

{
 'title': 'Tags',
 'type': 'text/x-moz-place-container',
 'root': 'tagsFolder',
 'children': [
   {
    'title': '<tag title>',
    'id': <tag id>,
    'type': 'text/x-moz-place-container',
    'children': [
      {
       'title': '',
       'id': <id of child>,
       'parent': <parent id>,
       'type': 'text/x-moz-place',
       'uri': 'http://',
       'charset': 'UTF-8'
      },{ <more children> }
     ]
   },{ <more children> }
  ]
},

Note that easiest to inspect a JSON backup is to open the file in the Scratchpad and click the pretty print button to make Firefox show the file formatted.

Dit antwurd yn kontekst lêze 👍 3

Alle antwurden (5)

more options
more options

Thanks for your developer links, edmeister! Currently all information is helpful, since I'm totally new in using Firefox.

FrankR

more options

Keazen oplossing

Tags basically have this structure if you search the bookmarks JSON backup for tags:

{
 'title': 'Tags',
 'type': 'text/x-moz-place-container',
 'root': 'tagsFolder',
 'children': [
   {
    'title': '<tag title>',
    'id': <tag id>,
    'type': 'text/x-moz-place-container',
    'children': [
      {
       'title': '',
       'id': <id of child>,
       'parent': <parent id>,
       'type': 'text/x-moz-place',
       'uri': 'http://',
       'charset': 'UTF-8'
      },{ <more children> }
     ]
   },{ <more children> }
  ]
},

Note that easiest to inspect a JSON backup is to open the file in the Scratchpad and click the pretty print button to make Firefox show the file formatted.

more options

Many, many thanks to cor-el !!!

If I had seen these identifiers in the JSON bookmark backup before, I had no problem at all! All I needed was ... 'title': 'Tags', 'type': 'text/x-moz-place-container', 'root': 'tagsFolder', ...

But I didn't find anything like this! OK, a text beautyfier may be helpful to read the text by a human - but even the search function had its problems to find strings like "tag" - actually it didn't find a single occurance. And the file's overall complexity and redundancy of the makes additional problems without a specification.

In my original posting I even claimed that there were no identifiers like "tags" in the file. This was, of ourse, wrong! I just didn't see them!

Now I have all I need! I'm going to apply the Java EE JSON-API (available since Java EE 7) to read in a JSON bookmark backup and translate it to XML to import it everywhere I need (with bookmarks and tags!).


By the way: Do you know the meaning of the following identifiers - "GUID", e.g. "guid":"HD8o3potRm_A", "flags":0, "expires":4 ?


FrankR

Bewurke troch FrankR2014 op

more options