> 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/close-all-tabs.md).

# 关闭所有标签

关闭所有标签是指令浏览器进行清理并关闭所有打开的标签，只保留导航栏上的第一个标签（索引为 `0` 的标签）。此操作没有任何配置参数。

#### 实际示例：在切换账户或结束流程之前重置浏览器

在自动化运行过程中，您的脚本可能会由于点击广告链接、弹出窗口或检查邮件、检查钱包的页面而打开许多辅助标签。过多的后台标签会消耗计算机的RAM资源，并使后续的运行流程容易混淆界面。

* 应用方法：在脚本的末尾（在完全关闭浏览器的命令块之前）或在脚本的开头放置关闭所有标签的操作，以确保浏览器在开始新的工作周期之前始终处于最干净的状态。


---

# 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/close-all-tabs.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.
