Closed Bug 473011 Opened 14 years ago Closed 14 years ago

Make it easier for extensions to add extra items to mailContext menus

Categories

(Thunderbird :: Mail Window Front End, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: iannbugzilla, Assigned: iannbugzilla)

References

Details

Attachments

(1 obsolete file)

At the moment it is not straight forward for extensions to add extra items to the mailContext menus, for example Lightning replaces the fillMailContextMenu with its own variant and then does a callback to the original.
If other extensions use the same method then it may become very messy.

As suggested by Mnyromyr, we should just make fillMailContextMenu do a notifyObservers and then interest parties would a register a nsIObserver for that.
Blocks: 473012
Attachment #356408 - Flags: superreview?(bienvenu)
Attachment #356408 - Flags: review?(neil)
Attachment #356408 - Flags: review?(neil) → review?(mkmelin+mozilla)
(In reply to comment #0)
> At the moment it is not straight forward for extensions to add extra items to
> the mailContext menus, for example Lightning replaces the fillMailContextMenu
> with its own variant and then does a callback to the original.
It does? Where? (I looked for it and I failed to find it. Sorry.)

(From update of attachment 356408 [details] [diff] [review])
>+  observerService.notifyObservers(window, "mail:fillMailContextMenu", aTarget);
aTarget isn't a string. Also, this isn't useful to extensions, as they often have to overlay both the 3 pane and the message window, but only want to observe the mail context menu in the scope of the window that's opening it.
(In reply to comment #2)
> (In reply to comment #0)
> > At the moment it is not straight forward for extensions to add extra items to
> > the mailContext menus, for example Lightning replaces the fillMailContextMenu
> > with its own variant and then does a callback to the original.
> It does? Where? (I looked for it and I failed to find it. Sorry.)
It did until the fix for bug 473012 was checked in.
> 
> (From update of attachment 356408 [details] [diff] [review])
> >+  observerService.notifyObservers(window, "mail:fillMailContextMenu", aTarget);
> aTarget isn't a string. Also, this isn't useful to extensions, as they often
> have to overlay both the 3 pane and the message window, but only want to
> observe the mail context menu in the scope of the window that's opening it.
Do you mean just pass null as the 3rd argument or are you saying I should also be doing notifyObserver against something other than window?
Attachment #356408 - Flags: superreview?(bienvenu)
Attachment #356408 - Flags: review?(mkmelin+mozilla)
Attachment #356408 - Attachment is obsolete: true
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.