How can I work with the objects returned by 'tabs.query()'?

16 views Asked by At

I have three tabs open, when I print activeTab, on the console I get:

let activeTab = browser.tabs.query({currentWindow: true})

...
0: Object { id: 1, index: 0, windowId: 1, … }
1: Object { id: 2, index: 1, windowId: 1, … }
2: Object { id: 3, index: 2, windowId: 1, … }
length: 3
...

If I try to work with the object, such as getting its length or try array indexing into it, I just get undefined:

activeTab.length // undefined
activeTab[1]    //undefined

I am trying to familiarise myself with this method and its return object, such as getting the tabId property. Thanks for helping me.

0

There are 0 answers