> 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/active-tab.md).

# Active tab

Hành động này giúp tool chuyển sang một tab khác đang mở trên trình duyệt.

Giúp bạn làm việc đa nhiệm dễ dàng. Ví dụ: bạn đang ở tab A để lấy dữ liệu, sau đó dùng lệnh này để chuyển sang tab B rồi dán dữ liệu vào đó.

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

### Lưu Ý Quan Trọng

Sau khi chuyển, mọi thao tác tiếp theo (click, nhập liệu, cào dữ liệu) của tool sẽ chỉ chạy trên tab mới được chọn này.

### Tham Số Cấu Hình

* Type: Chọn phương thức để hệ thống xác định tab cần chuyển đổi:
  * By Index: Chuyển tab dựa theo số thứ tự vị trí (tính từ trái qua phải, bắt đầu từ số 0).
  * By Prefix URL: Chuyển tab dựa theo phần đầu của địa chỉ đường dẫn (URL). Hệ thống sẽ quét qua các tab đang mở, tab nào có URL bắt đầu bằng chuỗi ký tự bạn điền vào thì sẽ được kích hoạt lên.

#### 💡 Lời Khuyên Cho Người Dùng

Khi sử dụng tính năng chuyển tab, bạn nên ưu tiên chọn phương thức **By Prefix URL**.

Lý do là vì thứ tự tab (Index) có thể thay đổi không theo quy luật do cơ chế trả về từ Remote Port, dẫn đến việc dùng số thứ tự có thể không chính xác và làm gián đoạn kịch bản. Việc dùng Prefix URL sẽ đảm bảo tool luôn tìm đúng tab cần thiết bất kể vị trí của nó trên trình duyệt.

*Mẹo nhỏ: Sau khi trình duyệt bật lên các cửa sổ liên kết dạng popup (như cửa sổ đăng nhập Google, ví MetaMask...), bạn chỉ cần gọi hành động Active Tab với chỉ số 0 để quay trở về màn hình trình duyệt chính một cách nhanh chóng.*

<figure><img src="/files/xrjYTGtwomn6tYspiAnl" alt=""><figcaption></figcaption></figure>


---

# 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/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.
