Calling browser.mailtabs.getSelectedMessages on a message tab throws an exception
Categories
(Thunderbird :: Add-Ons: Extensions API, defect)
Tracking
(Not tracked)
People
(Reporter: liliakai, Unassigned)
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
Steps to reproduce:
Install a WebExtension with a browser action that opens a popup which calls browser.mailTabs.getSelectedMessages();
Open the debugger for the extension.
From the default 3-pane tab, double click a message to open it in its own tab. In this new tab, click the browser action button.
Actual results:
An exception is shown in the debugger:
Error: Invalid mail tab ID: 2 ExtensionUtils.jsm
uncaught exception: 2147746065 autosync.jsm:199:13
Expected results:
getSelectedMessages() should return a promise that eventually resolves. The result should contain the message displayed in the current tab.
Updated•5 years ago
|
Comment 1•5 years ago
|
||
It should throw an exception. A message open in a tab is not a mail tab, as far as the APIs are concerned… but we could change that.
Or we could finally implement the message display API(s) that we need to do things like this properly.
The latter is my preferred option, and I may have time to do it one day.
Comment 2•5 years ago
|
||
I'm currently working on an API to find the displayed message in bug 1575708. This will provide the same methods for 3-pane tabs, tabs that only display a message, and windows that only display a message.
Marking this bug as a dupe of that bug as it seems like the best way to resolve it.
Description
•