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

**URL:** https://discourse.mozilla.org/t/get-a-list-of-all-tabs-of-one-windows-not-across-all-windows/5021
**Category:** Development
**Created:** [October 31, 2015, 10:57pm UTC](https://discourse.mozilla.org/t/get-a-list-of-all-tabs-of-one-windows-not-across-all-windows/5021 "2015-10-31T22:57:30Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![christoph\_b](https://avatars.discourse-cdn.com/v4/letter/c/5f8ce5/32.png) [@christoph\_b](https://discourse.mozilla.org/u/christoph_b)
#### Post date: [October 31, 2015, 10:57pm UTC](https://discourse.mozilla.org/t/get-a-list-of-all-tabs-of-one-windows-not-across-all-windows/5021/1 "2015-10-31T22:57:31Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![noitidart](https://avatars.discourse-cdn.com/v4/letter/n/9f8e36/32.png) [@noitidart](https://discourse.mozilla.org/u/noitidart)
#### Post date: [November 1, 2015, 7:28am UTC](https://discourse.mozilla.org/t/get-a-list-of-all-tabs-of-one-windows-not-across-all-windows/5021/2 "2015-11-01T07:28:32Z")

</div>

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

---

<div class="post-metadata">

### Author: ![christoph\_b](https://avatars.discourse-cdn.com/v4/letter/c/5f8ce5/32.png) [@christoph\_b](https://discourse.mozilla.org/u/christoph_b)
#### Post date: [November 1, 2015, 10:08am UTC](https://discourse.mozilla.org/t/get-a-list-of-all-tabs-of-one-windows-not-across-all-windows/5021/3 "2015-11-01T10:08:15Z")

</div>

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](https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/tabs)  
[window API](https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/windows)

---

<div class="post-metadata">

### Author: ![noitidart](https://avatars.discourse-cdn.com/v4/letter/n/9f8e36/32.png) [@noitidart](https://discourse.mozilla.org/u/noitidart)
#### Post date: [November 1, 2015, 11:29am UTC](https://discourse.mozilla.org/t/get-a-list-of-all-tabs-of-one-windows-not-across-all-windows/5021/4 "2015-11-01T11:29:20Z")

</div>

Thanks for sharing christoph! 🙂

---

<div class="post-metadata">

### Author: ![Lithopsian](https://avatars.discourse-cdn.com/v4/letter/l/a587f6/32.png) [@Lithopsian](https://discourse.mozilla.org/u/Lithopsian)
#### Post date: [November 1, 2015, 2:59pm UTC](https://discourse.mozilla.org/t/get-a-list-of-all-tabs-of-one-windows-not-across-all-windows/5021/5 "2015-11-01T14:59:59Z")

</div>

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