Experiment function throws Error: Unknown sender or wrong actor for recvAPICall
Categories
(WebExtensions :: General, defect, P5)
Tracking
(Not tracked)
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
Comment 1•5 years ago
|
||
Can you post your code somewhere, it's hard to figure out what's happening without it.
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.
Updated•5 years ago
|
Updated•5 years ago
|
Comment 3•5 years ago
|
||
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.
Comment 4•4 years ago
|
||
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.
Updated•4 years ago
|
Comment 5•4 years ago
|
||
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;
Comment 6•4 years ago
|
||
I'm not convinced this is right in all cases, but it does fix the problem here.
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Description
•