Closed Bug 1607859 Opened 3 years ago Closed 2 years ago

Experiment function throws Error: Unknown sender or wrong actor for recvAPICall

Categories

(WebExtensions :: General, defect, P5)

defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1641577

People

(Reporter: alta88, Unassigned)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 obsolete file)

My extension has an experiment function invoked from the addons manager Options html page, which has access to browser.storage but needs the experiment to notify the data to an observer in the extension's chrome code (Thunderbird).

In debugging, it seems the receiveMessage() |sender| is in the form myId@mydomain.com.93 while the Hub.remotes map has the entry in the form myId@mydomain.com.14, thus the error. Is this intentional?

https://searchfox.org/mozilla-central/source/toolkit/components/extensions/ConduitsParent.jsm#271

Can you post your code somewhere, it's hard to figure out what's happening without it.

Flags: needinfo?(alta88)

An example extension is AttachmentCount. The experiments.js contains the function notifyStorageLocal(); the addons manager Options/Preferences page script options.js calls browser.attachmentcount.notifyStorageLocal() and the problem happens. Thanks for looking.

Flags: needinfo?(alta88)
Priority: -- → P5
Flags: needinfo?(tomica)

I don't actually have time to setup a Thunderbird dev environment to test, but if there are any errors/logs from the browser console you can post, i could look into them.

Flags: needinfo?(tomica)

This happens because of the way the code in bug 1604058 interacts with Thunderbird's Add-ons Manager.

In Firefox, extensions are multiprocess. Well, unless you use MOZ_FORCE_DISABLE_E10S I guess. In particular this means that the options page has no same-process parent.

However, Thunderbird is still single process. This means that the options page has the Thunderbird Add-ons Manager as its parent. The code in bug 1604058 doesn't approve of this. Because it's not expecting to see a system principal ancestor page, it gets so confused that it ends up throwing an exception in an attempt to throw an exception.

I don't know whether it helps anyone else out, but I've found that I can work around the problem by adding the following line of code to my options script:

window.browser = window.browser.extension.getBackgroundPage().browser;

I'm not convinced this is right in all cases, but it does fix the problem here.

Assignee: nobody → geoff
Status: NEW → ASSIGNED
Attachment #9177078 - Attachment is obsolete: true
Assignee: geoff → nobody
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → DUPLICATE
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.