DocsTab Managementbrowser_close_tab

browser_close_tab

Browser Close Tab

Close a specific tab by its ID. The tab is destroyed and its resources freed. If the closed tab was active, another tab becomes active. Cannot close the last remaining tab.

Usage Example

123456789101112
import asyncio
from owl_browser import OwlBrowser, RemoteConfig
# Async usage
async with OwlBrowser(config) as browser:
context = await browser.create_context()
context_id = context["context_id"]
await browser.close_tab(
context_id=context_id,
tab_id="value"
)

Parameters

Required

context_idstringrequired

The unique identifier of the browser context (e.g., 'ctx_000001')

tab_idstringrequired

The unique identifier of the tab to close, obtained from browser_get_tabs. Cannot close the last remaining tab in a context

Response

Returns a JSON object with the operation result.

{
  "success": true,
  "result": <value>
}