Closed Bug 1653497 Opened 1 year ago Closed 11 months ago

messenger.tabs.query fails with an exception when a compose window is open


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



(Not tracked)



(Reporter: florian.unger, Unassigned)


User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.119 Safari/537.36

Steps to reproduce:

From a addon background page I call messenger.tabs.query to check if the tab of the addon is already opened.

Actual results:

When a compose window is open the call of messenger.tabs.query fails with an exception Error: "An unexpected error occurred"

the details from the debug console are:

tabmail is null ext-mail.js:184

window.controllers/Controllers is deprecated. Do not use it for UA detection. blank

this.browser is null ext-tabs-base.js:231
get uri chrome://extensions/content/parent/ext-tabs-base.js:231
matches chrome://extensions/content/parent/ext-tabs-base.js:606
matches chrome://messenger/content/parent/ext-mail.js:620
query chrome://extensions/content/parent/ext-tabs-base.js:1989
InterpretGeneratorResume self-hosted:1284
next self-hosted:1239
from self-hosted:598
query chrome://messenger/content/parent/ext-tabs.js:538
query self-hosted:1003
result resource://gre/modules/ExtensionParent.jsm:1139
withPendingBrowser resource://gre/modules/ExtensionParent.jsm:770
result resource://gre/modules/ExtensionParent.jsm:1139
withTiming resource://gre/modules/ExtensionParent.jsm:1100
call resource://gre/modules/ExtensionParent.jsm:1138
AsyncFunctionNext self-hosted:839

Expected results:

it should not throw an exception but return the Tabs promise correctly

Summary: messenger.tabs.query fails with an exception when a compose windows is open → messenger.tabs.query fails with an exception when a compose window is open

I found out that the exception does not occur when I limit the query by setting queryInfo
currentWindow: true
windowType: "normal"

I guess the exception occurs when the query for tabs tries to find tabs in the compose window.
The above parameters limit the scope of the search to the main Thunderbird windows and exclude the compose windows from the query.

Is this still happening for you in TB78?

Probably fixed by bug 1674407.

Closed: 11 months ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1674407
You need to log in before you can comment on or make changes to this bug.