本文介绍了在Google Chrome浏览器中使用JavaScript控制台,如何获取所选/活动/当前标签页的索引?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我正在尝试检索当前活动/选定/当前选项卡的索引.运行什么命令将检索索引?

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?

推荐答案

您需要使用 Chrome API ,扩展程序和应用程序均可使用.

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

这篇关于在Google Chrome浏览器中使用JavaScript控制台,如何获取所选/活动/当前标签页的索引?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 20:13