On Thu, Sep 17, 2009 at 2:35 AM, karl <[email protected]> wrote:

>
> I'm sure I'm missing something obvious here, but how do I get the
> tabId (and windowId) of the "current tab" (ie the one that this
> toolstrip is attached to).
> note: this may will not be the topmost/focused tab if this code is
> being run in a background tab's toolstrip.
>

Toolstrips are not per-tab, they are per-window. So there is no such thing
as getting the tab id of the tab that a toolstrip is attached to.

You can get the tab id of the selected tab in the current window (that is,
the window that the toolstrip is running in), like this:

chrome.tabs.getSelected(null, function(tab) {
  console.log(tab.id);
});

 - a

--~--~---------~--~----~------------~-------~--~----~
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