Open
Bug 1291274
Opened 8 years ago
Updated 9 months ago
Consider adding bookmarks API method to get ID of standard/common folders
Categories
(WebExtensions :: General, enhancement, P5)
WebExtensions
General
Tracking
(Not tracked)
NEW
People
(Reporter: sheppy, Unassigned, Mentored)
Details
(Whiteboard: [bookmarks]triaged)
There are certain folders which are fairly common among browsers which would be helpful to be able to quickly get access to. This could be done with properties, such as: bookmarks.unfiledFolder or bookmarks.toolbarFolder, or using a method, like bookmarks.getToolbarFolder() or bookmarks.getStandardFolder(foldername) where foldername is a special identifier like "toolbar", "unfiled", or "recents". If the identifiers of common folders are standardized in some way, this would allow extensions to find these special folders easily regardless of which browser they're on. For example, I could then bookmark MDN into the bookmarks toolbar like this: chrome.bookmarks.create({ parentId: chrome.bookmarks.getToolbarFolder(), title: "MDN", "https://developer.mozilla.org/" }); This provides for cleaner, simpler code in the extension than having to query for the folder, especially since you don't necessarily know its name. This code would "just work" (assuming we can convince others to go along with the addition of a feature like this).
Updated•8 years ago
|
Whiteboard: [bookmarks][design decision needed]
Updated•8 years ago
|
Assignee: nobody → kmaglione+bmo
Reporter | ||
Comment 1•8 years ago
|
||
FWIW, as someone who documents a lot of APIs, I feel like the most consistent solution would be a bookmarks.getStandardFolder() method which would then take a simple string ID to determine which folder to retrieve: "root", "toolbar", "menu", "unfiled", "remote", "local", and so forth. This would be the most flexible, probably, too, since it would be relatively quick to add more, and would discourage every browser outfit from adding new methods for all their unusual or special bookmark folders; they could just add them to the ones supported by getStandardFolder().
Comment 2•8 years ago
|
||
I was planning to just add constants.
Updated•8 years ago
|
Whiteboard: [bookmarks][design decision needed] → [bookmarks]triaged
Comment 3•8 years ago
|
||
This API discussed in this bug is, sadly, absent from Blink. In my Chrome and Opera extensions, I get these folders from their position in the root tree, which I have reverse-engineered. A proper API, such as proposed here, would be wonderful.
Updated•7 years ago
|
Severity: normal → enhancement
Priority: -- → P5
Updated•6 years ago
|
Product: Toolkit → WebExtensions
Comment 4•6 years ago
|
||
Bulk move of bugs per https://bugzilla.mozilla.org/show_bug.cgi?id=1483958
Component: Untriaged → General
Updated•6 years ago
|
Assignee: kmaglione+bmo → nobody
Mentor: kmaglione+bmo
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•