Closed Bug 1871879 Opened 1 year ago Closed 1 year ago

messenger.runtime.openOptionsPage() no longer works from extension

Categories

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

Thunderbird 115
defect

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: 52qtuqm9, Unassigned)

Details

Attachments

(1 file)

854 bytes, application/x-xpinstall
Details

I get this in the console when I call messenger.runtime.openOptionsPage() from my extension's background script:

15:28:04.649 tab.browser is undefined mailCore.js:662
    openAddonsMgr chrome://messenger/content/mailCore.js:662
    openAddonsMgr chrome://messenger/content/mailCore.js:632
    openOptionsPage chrome://messenger/content/parent/ext-mail.js:157
    openOptionsPage chrome://extensions/content/parent/ext-runtime.js:202
    result resource://gre/modules/ExtensionParent.sys.mjs:1144
    withCallContextData resource://gre/modules/ExtensionParent.sys.mjs:627
    result resource://gre/modules/ExtensionParent.sys.mjs:1143
    withPendingBrowser resource://gre/modules/ExtensionParent.sys.mjs:637
    result resource://gre/modules/ExtensionParent.sys.mjs:1142
    callAndLog resource://gre/modules/ExtensionParent.sys.mjs:1095
    recvAPICall resource://gre/modules/ExtensionParent.sys.mjs:1141
    AsyncFunctionNext self-hosted:852

It then opens the main add-ons page rather than the options for my extension.

Attached file test.xpi

Jonathan, I am not able to reproduce the problem with this simple test add-on. It works just fine on Arch Linux with Thunderbird 115.6.0.

In a new profile I also installed Send Later 10.3.3. Using the browser action to open the settings worked just fine as well. There are also no errors or warnings in the error console.

I am also unable to reproduce it in other profiles.

Doesn't change the fact that it is happening consistently in 115.6.0 in this particular profile, with the stack trace above every time.

That it's an intermittent or hard to reproduce bug doesn't mean that it isn't a bug.

@Jonathan: Is Alexanders test.xpi reproducing the bug in your mentioned profile? If not, can you share which of your add-ons does? Attaching the specific version to this bug would be great.

(In reply to John Bieling (:TbSync) from comment #3)

@Jonathan: Is Alexanders test.xpi reproducing the bug in your mentioned profile?

Intermittently, yes.

Immediately after installing test.xpi the browser action button correctly opened its preferences.

However, after restarting Thunderbird with it installed, the action button no longer correctly opens its preferences.

I'm observing this problem with Send Later, both 10.3.5 and 10.3.6 (current beta release).

Hi Jonathan, I will not be able to fix this without your help. The standard call to open a content tab fails for you.

  1. Could you manually disable all other add-ons in that profile (besides test.xpi) and restart(!)? Does that make the error go away?
  2. If not, what is the tab situation after you restarted Thunderbird (which tabs are open), before you use text.xpi to open the options page and it fails?
  3. Could you open a console and manually execute openContentTab("about:addons");, what happens? Does it return a tab in the console and does it switch to the addon manager?

Hi Jonathan, I will not be able to fix this without your help. The standard call to open a content tab fails for you.

  1. Could you manually disable all other add-ons in that profile (besides test.xpi) and restart(!)? Does that make the error go away?
  2. If not, what is the tab situation after you restarted Thunderbird (which tabs are open), before you use text.xpi to open the options page and it fails?
  3. Could you open a console and manually execute openContentTab("about:addons");, what happens? Does it return a tab in the console and does it switch to the addon manager?

Tested with add-ons disabled and couldn't reproduce the issue. Started reenabling add-ons one by one and narrowed it down to https://github.com/opto/expression-search-NG .

Also: it's not just immediately after install vs. after restart. Immediately after install the button works properly the first time but then if I close the prefs tab and press the button again it fails.

Confirmed.

I am forwarding this unfortunate behavior to the developer of Expression Search NG.

Status: UNCONFIRMED → RESOLVED
Closed: 1 year ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: