tabs.query failing (returning undefined) in browser action popup
Categories
(GeckoView :: Extensions, defect, P1)
Tracking
(firefox80 fixed)
Tracking | Status | |
---|---|---|
firefox80 | --- | fixed |
People
(Reporter: csadilek, Assigned: agi)
References
Details
(Whiteboard: [geckoview:m80][fenix:p1])
Attachments
(5 files)
Not clear if a general problem or specific to Youtube High Definition add-on.
Fenix bug: https://github.com/mozilla-mobile/fenix/issues/12305
can't access property "id", tabs[0] is undefined popup.js:41
requestVideoQualitySizeChange moz-extension://00a47bb7-8a3c-4fea-9c35-c1134b18cb41/popup.js:41
apply self-hosted:2159
applySafeWithoutClone resource://gre/modules/ExtensionCommon.jsm:614
wrapPromise resource://gre/modules/ExtensionCommon.jsm:823
(Async: promise callback)
wrapPromise resource://gre/modules/ExtensionCommon.jsm:813
callParentAsyncFunction resource://gre/modules/ExtensionChild.jsm:845
callAsyncFunction resource://gre/modules/ExtensionChild.jsm:602
stub resource://gre/modules/Schemas.jsm:2679
requestVideoQualitySizeChange moz-extension://00a47bb7-8a3c-4fea-9c35-c1134b18cb41/popup.js:37
_dispatchEvents resource://gre/modules/GeckoViewPrompt.jsm:194
_handleSelect resource://gre/modules/GeckoViewPrompt.jsm:156
onResponse resource://gre/modules/GeckoViewPrompter.jsm:103
Querying code:
chrome.tabs.query({
active: true,
currentWindow: true
}, function(tabs) {
chrome.tabs.sendMessage(tabs[0].id, { action: 'video_qualitysize_change', 'quality': q, 'size': s, 'speed': ss, "volume": volume, "volumelevel": volumelevel, suggestedautoplay: suggestedautoplay, autoexpanddescription: autoexpanddescription, "isOptionHandle": true }, function(response) {
});
});
Assignee | ||
Comment 1•4 years ago
|
||
I think the problem here is that the popup is in a separate window in GV and so requesting the "currentWindow" doesn't work. We need to work around this somehow.
Updated•4 years ago
|
Comment 2•4 years ago
|
||
I heard that you were working on it Agi. I'll be on the lookout for your patch to verify whether the fix conforms to the definition of the extension API.
Assignee | ||
Comment 3•4 years ago
|
||
Assignee | ||
Comment 4•4 years ago
|
||
We use this object on the Java side to open the popup and without this change
we don't look at the default popup URL when the tab-specific one is not
defined.
Assignee | ||
Comment 5•4 years ago
|
||
Assignee | ||
Comment 6•4 years ago
|
||
When using the tabs.query
API in a popup (e.g. a browserAction popup)
extensions expects to refer to the window where the popup is.
On mobile we don't really have a concept of window in the way that extensions
expect us to have, we also treat all tabs as belonging to separate tabs.
To make the behavior of the extension API more consistent with desktop, we
pretend that the popup belongs to whatever the top tab is at the time.
Assignee | ||
Comment 7•4 years ago
|
||
Pushed by asferro@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2340ac8f960f Remove empty delegate methods in TestRunnerActivity. r=owlish https://hg.mozilla.org/integration/autoland/rev/e904e980b556 Send the entire Action object for openPopup. r=owlish https://hg.mozilla.org/integration/autoland/rev/2f2aa2cc7654 Support browser action popups in TestRunnerActivity. r=owlish https://hg.mozilla.org/integration/autoland/rev/d2fb87bfa361 Track active tab in a Deque in TestRunnerActivity. r=esawin https://hg.mozilla.org/integration/autoland/rev/ed799c847e3f Return the top window for extension popups. r=robwu,owlish
Comment 9•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/2340ac8f960f
https://hg.mozilla.org/mozilla-central/rev/e904e980b556
https://hg.mozilla.org/mozilla-central/rev/2f2aa2cc7654
https://hg.mozilla.org/mozilla-central/rev/d2fb87bfa361
https://hg.mozilla.org/mozilla-central/rev/ed799c847e3f
Description
•