开发者

Using JavaScript console in Google Chrome how can I get the index of the selected/active/current Tab?

开发者 https://www.devze.com 2023-03-31 21:17 出处:网络
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, wh

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

精彩评论

暂无评论...
验证码 换一张
取 消