On Fri, Sep 11, 2009 at 5:38 AM, Chung Wu <[email protected]> wrote:
> Hi all,
> I'm trying to find the number of tabs in a particular window; I already have
> the windowId.
> However, I was surprised to find that chrome.windows.get() will not return a
> Window with the "tabs" field populated.  Instead, I have to call
> chrome.windows.getAll({populate: true}) to get an array of Windows, and then
> find the Window with the id that I wanted.
> It seems weird to presume that I'd want tabs in a window only when I'm
> interested in all windows.
> Is there any reason why get() doesn't allow me to specify {populate: true}?
>  Same, for getCurrent(), getLastFocused(), etc.?  Or is there an easier way
> to do what I want to do?
> Thanks!
> Chung

How about: chrome.tabs.getAllInWindow
(http://code.google.com/chrome/extensions/tabs.html#method-getAllInWindow)

Callback with an array of tabs as an argument, which you can just call
.length on

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Chromium-extensions" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/chromium-extensions?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to