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

RESOLVED WONTFIX

Status

Thunderbird
Mail Window Front End
RESOLVED WONTFIX
9 years ago
9 years ago

People

(Reporter: Ian Neal, Assigned: Ian Neal)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 obsolete attachment)

(Assignee)

Description

9 years ago
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.
(Assignee)

Updated

9 years ago
Blocks: 473012
(Assignee)

Comment 1

9 years ago
Created attachment 356408 [details] [diff] [review]
Add notifyObserver to fillMailContextMenu patch v0.1
Attachment #356408 - Flags: superreview?(bienvenu)
Attachment #356408 - Flags: review?(neil)
(Assignee)

Updated

9 years ago
Attachment #356408 - Flags: review?(neil) → review?(mkmelin+mozilla)

Comment 2

9 years ago
(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.
(Assignee)

Comment 3

9 years ago
(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?
(Assignee)

Updated

9 years ago
Attachment #356408 - Flags: superreview?(bienvenu)
Attachment #356408 - Flags: review?(mkmelin+mozilla)
(Assignee)

Updated

9 years ago
Attachment #356408 - Attachment is obsolete: true
(Assignee)

Updated

9 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.