> For the complete documentation index, see [llms.txt](https://docs.gpmautomate.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gpmautomate.com/automate-zh/cao-zuo-zhi-nan/navigation/active-tab.md).

# 活动标签

此操作帮助工具切换到浏览器中打开的另一个标签。

帮助您轻松进行多任务处理。例如：您在标签 A 中获取数据，然后使用此命令切换到标签 B 并将数据粘贴到那里。

### 重要注意事项

切换后，工具的所有后续操作（点击、输入、抓取数据）将仅在新选择的标签上运行。

### 配置参数

* 类型：选择系统确定需要切换的标签的方法：
  * 按索引：根据位置的顺序（从左到右，从 0 开始）切换标签。
  * 按前缀 URL：根据地址路径（URL）的开头部分切换标签。系统将扫描打开的标签，任何 URL 以您输入的字符串开头的标签将被激活。

#### 💡 用户建议

使用切换标签功能时，您应该优先选择 **按前缀 URL** 方法。

原因是标签的顺序（索引）可能由于远程端口的返回机制而不规则变化，导致使用索引可能不准确并中断脚本。使用前缀 URL 将确保工具始终找到所需的标签，无论其在浏览器中的位置如何。

*小提示：在浏览器弹出窗口（如 Google 登录窗口、MetaMask 窗口等）打开后，您只需调用活动标签操作，使用索引 0 快速返回主浏览器屏幕。*


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.gpmautomate.com/automate-zh/cao-zuo-zhi-nan/navigation/active-tab.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
