> 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).

# Close all tab

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

🎥 查看更多教程视频：[在这里](https://youtu.be/a9qNt96X1SM)。

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

在自动化运行过程中，您的脚本可能会由于点击广告链接、弹出窗口或检查邮件、检查钱包的页面而打开许多子标签。保持过多的标签在后台运行会消耗计算机的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.
