Skip to content Skip to sidebar Skip to footer

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 the command to run which will retrieve the Index?

Solution 1:

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);
});

Post a Comment for "Using Javascript Console In Google Chrome How Can I Get The Index Of The Selected/active/current Tab?"