Search code examples
javascriptfirefoxoopfirefox-addonbookmarks

How can you get a list or traversable tree of bookmarks from within a Firefox Extension?


I am working on a simple Firefox Extension, and I need a list of the user's bookmarks. I have found the nsINavBookmarksService class which appears to be the recommended way of manipulating bookmarks since Firefox 3.0. Strangely I don't see a method that I could use to get a list of all the bookmarks in a folder. I need some way of creating a flat list of all the Bookmark URIs, but without any methods that return information about more than one bookmark I don't see a way to do it.


Solution

  • This tutorial is what you want Places Query API

    The bookmarks are in a sqlite file in the profile directory and you need to use the query api to read them.

    Good luck!