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