Using JavaScript console in Google Chrome how can I get the index of the selected/active/current Tab?
I am trying to retrieve the index of the currently active/selected/current tab. What is开发者_Python百科 the command to run which will retrieve the Index?
You would need to use Chrome API for this, which is available to extensions and apps.
chrome.tabs.getSelected(null, function(tab){
console.log("index:", tab.index);
});
精彩评论