Get a list of all tabs of one windows NOT across all windows?

To get information of all tabs i normally iterate

var tabs = require("sdk/tabs");
for (let tab of tabs)
    console.log(tab.title);

tabs contains a list of all opened tabs across all windows, but I just need a list of tabs of one window.
So if I have multipe windows open, I just want the tabs from the window I startet my action.
Is it possible to get such a list? Or have tabs information in which windows there are, so that i can set them apart?

Does each tab in tabs hold something like a window id? If tab is an xul element, you can test ownerDocument.

No idea why I did not see it yesterday, but tab has a window object.
I used the High-Level APIs tabs, but there is also a windows API, which has a list of tabs in this window. This object has the same interface as the tabs API, except it contains only the tabs in this window, not all tabs in all windows. So exactly what I need.

tabs API
window API

Thanks for sharing christoph! :slight_smile:

Easiest to start with the window you want. Then it has a very straightforward lists of tabs, so no need for extra APIs.