标签
🌐 Tabs
browser_tabs
管理浏览器标签页——列出、创建、关闭或选择一个标签页。
🌐 Manage browser tabs — list, create, close, or select a tab.
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
action | string | 是 | list、new、close 或 select |
index | number | 否 | 标签页索引,用于 close/select。如果在 close 中省略,则关闭当前标签页 |
url | string | 否 | 新标签页中要跳转的 URL,用于 new |
每个操作都会返回结果标签列表。
🌐 Every action returns the resulting tab list.
列出所有标签
🌐 List all tabs
→ browser_tabs { action: "list" }
- 0: [](about:blank)
- 1: (current) [React • TodoMVC](https://demo.playwright.dev/todomvc)
- 2: [Example Domain](https://example.com)
标签从0开始编号,当前活动的标签标记为 (current),崩溃的标签标记为 [crashed]。
🌐 Tabs are numbered from 0, the active one is marked (current), and a crashed tab is marked [crashed].
打开一个新标签页
🌐 Open a new tab
→ browser_tabs { action: "new", url: "https://example.com" }
→ Returns a snapshot of the new tab
省略 url 可以打开一个空白标签页。
🌐 Omit url to open a blank tab.
切换到一个标签
🌐 Switch to a tab
→ browser_tabs { action: "select", index: 1 }
关闭标签页
🌐 Close a tab
→ browser_tabs { action: "close" } // close current tab
→ browser_tabs { action: "close", index: 2 } // close specific tab
工作流程:比较两个页面
🌐 Workflow: comparing two pages
You: Open staging and production, compare the headers.
→ browser_navigate { url: "https://staging.example.com" }
→ browser_snapshot // snapshot of staging
→ browser_tabs { action: "new", url: "https://example.com" }
→ browser_snapshot // snapshot of production
// LLM compares the two snapshots