On Thu, Sep 17, 2009 at 10: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.
>
> I want to know if this toolstrip is attached to the focused tab, and I
> can find the focused tabId by using the following,
>
> chrome.windows.getCurrent(function(thisWin){
> chrome.tabs.getSelected(thisWin.id, function(tab){
> var selectedTabId = tab.id;
> });
> });
>
> But now i need to compare it to the currentTabId.
How about:
chrome.windows.getLastFocused(function(topWin){
chrome.tabs.getSelected(topWin.id, function(tab){
var currentTabId = tab.id;
});
});
(Sorry for double-message karl, replied rather than replied to all)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---