I am writing a Firefox add-on code that manages user bookmarks.
I started with the Bookmark Search code from https://developer.mozilla.org/En/Places_Developer_Guide and ended up writing the following code that works ...
var folders = [bookmarksService.bookmarksMenuFolder, bookmarksService.toolbarFolder, bookmarksService.unfiledBookmarksFolder]; var bookmarks = []; for (var i = 0; i < 3; i++) { query.setFolders([folders[i]], 1); var result = historyService.executeQuery(query, options); var rootNode = result.root; rootNode.containerOpen = true; getNode(rootNode, bookmarks); rootNode.containerOpen = false; }
The problem with this code is that it hardcodes 3 folders by default. I would like the code to handle the case when the user created their own folder folders.
How can this code be changed so that it moves across all bookmark folders?
source share