Closed Bug 1629023 Opened 6 months ago Closed 5 months ago

browser.compose.beginNew/Reply/Forward should return a handle/tabID for getComposeDetails

Categories

(Thunderbird :: Add-Ons: Extensions API, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 77.0

People

(Reporter: buecher, Assigned: darktrojan)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; rv:74.0) Gecko/20100101 Firefox/74.0

Steps to reproduce:

Especialy for a reply/Forward, I might want to change the content of the composeWindow after await beginReply.
We have the getComposeDetails/setComposeDetails, but they need a tabId which we don't know.

Maybe return a handle/tabId from the begin.. functions?

For attempts of several, also using the listener on browser.windows.onCreated, see https://thunderbird.topicbox.com/groups/addons/T70a8762a710b9b43/compose-api

workaround from topicbox:
if (window.type == "messageCompose") {

browser.tabs.query({windowId:window.id})
.then (details => {
  console.log(details);

  browser.compose.getComposeDetails(details[0].id)
  .then(tabdetails => {
    console.log(tabdetails);
  });
});

}

probably works only if there is only 1 compose window open

Assignee: nobody → geoff
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #9141103 - Flags: review?(mkmelin+mozilla)
Attachment #9141103 - Flags: review?(mkmelin+mozilla) → review+

Resetting severity to default of --.

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/756d8f7c9119
Return a tab object from compose.begin* functions. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 77.0
You need to log in before you can comment on or make changes to this bug.