dict["parent"] = b.parent_idx
dict["title"] = b.name.decode('utf-8')
dict["type"] = "text/x-moz-place"
- dict["uri"] = b.href
+ dict["uri"] = uri = b.href
+ if uri.startswith('place:'):
+ if uri.startswith('place:sort=8'):
+ value = 'MostVisited'
+ elif uri.startswith('place:folder=BOOKMARKS_MENU'):
+ value = 'RecentlyBookmarked'
+ elif uri.startswith('place:sort=14'):
+ value = 'RecentTags'
+ dict["annos"] = make_annos(value, name='Places/SmartBookmark')
+ del dict["dateAdded"]
+ del dict["lastModified"]
self.folder_stack[-1].append(dict)
def ruler(self, r, level):
return None
-def make_annos(comment):
+def make_annos(value, name="bookmarkProperties/description"):
return [{
"expires": 4,
"flags": 0,
"mimeType": None,
- "name": "bookmarkProperties/description",
+ "name": name,
"type": 3,
- "value": comment.decode('utf-8')}]
+ "value": value.decode('utf-8')}]