DocsContext Managementbrowser_close_context

browser_close_context

Browser Close Context

Close a browser context and release all associated resources including cookies, storage, and network connections. Always close contexts when done to free up memory. Any ongoing operations in the context will be terminated.

Usage Example

1234567891011
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_context(
context_id=context_id
)

Parameters

Required

context_idstringrequired

The unique identifier of the browser context to close (e.g., 'ctx_000001'). Obtained from browser_create_context or browser_list_contexts

Response

Returns a JSON object with the operation result.

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