Open Bug 1319530 Opened 8 years ago Updated 1 years ago

Implement bookmarks.onChildrenReordered WebExtensions API event

Categories

(WebExtensions :: Compatibility, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: bsilverberg, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

(Whiteboard: [bookmarks]triaged)

Chrome has an API event called onChildrenReordered, which is only fired when the "Organize" menu in the Bookmarks Manager is used to sort the bookmarks in a folder. As Firefox does not have this ability, there is never a time when onChildrenReordered could be fired. We therefore should simply implement this as a stub that does nothing, so that errors will not be thrown if a user tries to add a listener to this event.
(In reply to Bob Silverberg [:bsilverberg] from comment #0) > As Firefox does not have this ability, there is never a time > when onChildrenReordered could be fired. This is incorrect, right clicking on a bookmarks folder you can pick Sort by Name, that afaict does the same thing. This in future will map 1:1 with Bookmarks.jsm::reorder, firing a notification from there shuld be trivial I think. Currently instead it's done through a complex index setting loop in PlacesSortFolderByNameTransaction... but it should still be possible to fire this notification.
Thanks Marco! I tried navigating around the Bookmarks dialog to see if I could find something similar to Chrome, but I missed that piece of functionality. It looks like we _can_ implement this event. What is the timing for Bookmarks.jsm::reorder? Is there a bug for that? I wonder if it makes sense to try to implement this now, or if we should just wait for that other change?
Mentor: bob.silverberg
Flags: needinfo?(mak77)
Summary: Implement bookmarks.onChildrenReordered WebExtensions API event as a stub → Implement bookmarks.onChildrenReordered WebExtensions API event
Whiteboard: [bookmarks][good first bug]triaged → [bookmarks]triaged
I don't have an ETA for the reorder replacement. That said, we could add a notification to nsINavBookmarkObserver and call it from both places. There is a difference still, since reorder fires onItemMoved for each item while the Chrome API doesn't. IF we change that, we'll have to audit the consumers of onItemMoved and move some of them to the new notification.
Flags: needinfo?(mak77)
Depends on: 1339390
Product: Toolkit → WebExtensions
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.