When running browser.tabs.query({}) the index of all tabs is 0
Categories
(Firefox for Android :: WebExtensions, defect)
Tracking
()
People
(Reporter: boek, Unassigned)
References
(Depends on 1 open bug, Blocks 2 open bugs)
Details
From github: https://github.com/mozilla-mobile/fenix/issues/26369.
Steps to reproduce
I noticed this bug when porting my Firefox addon to Android. When I get tabs using
browser.tabs.query({}).then(e=> { console.log(e)}), I look for the index property in each of the tabs
- Load any temporary extension in about:debugging (just to open the about:devtools-toolbox console)
- Click inspect to open the about:devtools-toolbox then click Console
- Paste the following line:
browser.tabs.query({}).then(e=> { console.log(e)})- Look at the console output. For each of the tab objects, the index integer should be different
I think the index property should list the tabs in the order as they're viewed by the user on Android too.
Expected behaviour
On Firefox Nightly on Windows, the index integer is different for every tab.
Here is an example output:Array(24) [ {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, … ] 0: Object { id: 1, index: 0, windowId: 1, … } 1: Object { id: 8, index: 1, windowId: 1, … } 2: Object { id: 32, index: 2, windowId: 1, … }Actual behaviour
- Load an addon in Firefox Nightly on Android (using web-ext)
- Go to about:debugging#/setup in Firefox Nightly on your computer and enable USB debugging
- To select your device, click connect
- Click inspect to open the about:devtools-toolbox then click Console
- Paste the following line:
browser.tabs.query({}).then(e=> { console.log(e)})- Look at the console output. For each of the tab objects, the index integer is the same:
Array [ {…}, {…} ] 0: Object { id: 10051, index: 0, windowId: 51, … } 1: Object { id: 10058, index: 0, windowId: 58, … }Device name
No response
Android version
Android 12
Firefox release type
Firefox Nightly
Firefox version
105
Device logs
No response
Additional information
No response
┆Issue is synchronized with this Jira Task
Change performed by the Move to Bugzilla add-on.
| Reporter | ||
Updated•2 years ago
|
Comment 1•2 years ago
|
||
"Currently, every "tab" on Fenix is in its own window." - https://bugzilla.mozilla.org/show_bug.cgi?id=1372178#c7
We'd need to properly support the concept of multiple tabs grouped together before we can meaningfully export index != 0. The concept of "multiple tabs together" is also a prerequisite for bug 1817772.
And bug 1583281 is also needed - the extension API internals need to be aware of non-loaded tabs before a meaningful index can be exposed.
Description
•