> 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/huong-dan-cac-action/navigation/close-all-tab.md).

# Close all tab

Close all tab là hành động ra lệnh cho trình duyệt tiến hành dọn dẹp và tắt hàng loạt các thẻ đang mở, chỉ giữ lại duy nhất thẻ đầu tiên (tab có index = `0`) trên thanh điều hướng. Hành động này không có tham số cấu hình nào kèm theo.

🎥 Xem thêm video hướng dẫn: [Tại đây](https://youtu.be/a9qNt96X1SM).

#### Ví dụ thực tế: Reset trình duyệt trước khi chuyển tài khoản hoặc kết thúc luồng

Trong quá trình chạy automation, kịch bản của bạn có thể mở ra rất nhiều tab phụ do nhấn vào các đường link quảng cáo, popup hoặc các trang check mail, check ví. Việc để quá nhiều tab chạy ngầm sẽ làm ngốn tài nguyên RAM của máy tính và khiến các luồng chạy sau dễ bị nhầm lẫn giao diện.

* Cách áp dụng: Đặt hành động Close all tab ở cuối kịch bản (trước khối lệnh đóng trình duyệt hoàn toàn) hoặc ở đầu kịch bản để đảm bảo trình duyệt luôn ở trạng thái sạch sẽ nhất trước khi bắt đầu một chu trình làm việc mới.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.gpmautomate.com/huong-dan-cac-action/navigation/close-all-tab.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
