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?
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.