How to export the whole bookmark tree in JSON?

2,600 views
Skip to first unread message

Derek 囧

unread,
Sep 2, 2011, 4:43:35 PM9/2/11
to Chromium-extensions
I want to export the whole bookmark tree (including folders and
children) in JSON, and import the JSON file in another computer.
How can I do that?

Thanks.

Derek 囧

unread,
Sep 2, 2011, 5:41:28 PM9/2/11
to Chromium-extensions
Ok, I used
chrome.bookmarks.getTree(function (tree)
JSON.stringify(tree)
}
to export in JSON, but now the problem is how to import it?

Frédérik Labbé

unread,
Sep 3, 2011, 11:08:17 AM9/3/11
to Chromium-extensions
you can do some kind of reverse engineering to import data; I done
that once and it worked pretty fine !

when exporting, you ask the user to copy a stringified version of all
the bookmarks, then when importing, you ask the user to past this
stringified version

now you only have to rebuild the json objects with :
var bookmarks = JSON.parse(str);

hope this helps

Derek 囧

unread,
Sep 3, 2011, 11:36:52 PM9/3/11
to Chromium-extensions
Thanks, and I built a successful one!
Reply all
Reply to author
Forward
0 new messages