Implement bookmarks.onChildrenReordered WebExtensions API event

NEW
Unassigned

Status

()

Toolkit
WebExtensions: Compatibility
P3
normal
6 months ago
3 months ago

People

(Reporter: bsilverberg, Unassigned)

Tracking

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

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [bookmarks]triaged)

(Reporter)

Description

6 months ago
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.

Comment 1

6 months ago
(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.
(Reporter)

Comment 2

6 months ago
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@gmail.com
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

Comment 3

6 months ago
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)

Updated

3 months ago
Depends on: 1339390
You need to log in before you can comment on or make changes to this bug.