> ## Documentation Index
> Fetch the complete documentation index at: https://docs.camel-ai.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Camel.toolkits.hybrid browser toolkit.hybrid browser toolkit

<a id="camel.toolkits.hybrid_browser_toolkit.hybrid_browser_toolkit" />

<a id="camel.toolkits.hybrid_browser_toolkit.hybrid_browser_toolkit.HybridBrowserToolkit" />

## HybridBrowserToolkit

```python theme={"system"}
class HybridBrowserToolkit(BaseToolkit):
```

A hybrid browser toolkit that can switch between TypeScript and Python
implementations.

This wrapper allows users to choose between:

* 'typescript': WebSocket-based implementation using TypeScript/Node.js
* 'python': Pure Python implementation using Playwright directly

**Parameters:**

* **mode** (`Literal["typescript", "python"]`): Implementation mode. - 'typescript': Uses WebSocket-based TypeScript implementation - 'python': Uses pure Python Playwright implementation. Defaults to "typescript".
* **headless** (bool): Whether to run browser in headless mode. Defaults to True.
* **user\_data\_dir** (Optional\[str]): Directory for user data persistence. Defaults to None.
* **stealth** (bool): Whether to enable stealth mode. Defaults to False.
* **cache\_dir** (str): Directory for caching. Defaults to "tmp/". (default: `"tmp/"`)
* **enabled\_tools** (Optional\[List\[str]]): List of enabled tools. Defaults to None.
* **browser\_log\_to\_file** (bool): Whether to log browser actions to file. Defaults to False.
* **log\_dir** (Optional\[str]): Custom directory path for log files. If None, defaults to "browser\_log". Defaults to None.
* **session\_id** (Optional\[str]): Session identifier. Defaults to None.
* **default\_start\_url** (str): Default URL to start with. Defaults to "[https://google.com/](https://google.com/)".
* **default\_timeout** (Optional\[int]): Default timeout in milliseconds. Defaults to None.
* **short\_timeout** (Optional\[int]): Short timeout in milliseconds. Defaults to None.
* **navigation\_timeout** (Optional\[int]): Navigation timeout in milliseconds. Defaults to None.
* **network\_idle\_timeout** (Optional\[int]): Network idle timeout in milliseconds. Defaults to None.
* **screenshot\_timeout** (Optional\[int]): Screenshot timeout in milliseconds. Defaults to None.
* **page\_stability\_timeout** (Optional\[int]): Page stability timeout in milliseconds. Defaults to None.
* **dom\_content\_loaded\_timeout** (Optional\[int]): DOM content loaded timeout in milliseconds. Defaults to None.
* **viewport\_limit** (bool): Whether to filter page snapshot elements to only those visible in the current viewport. Defaults to False.
* **connect\_over\_cdp** (bool): Whether to connect to an existing browser via Chrome DevTools Protocol. Defaults to False. (Only supported in TypeScript mode)
* **cdp\_url** (Optional\[str]): WebSocket endpoint URL for CDP connection. Required when connect\_over\_cdp is True. Defaults to None. (Only supported in TypeScript mode)
* **cdp\_keep\_current\_page** (bool): When True and using CDP mode, won't create new pages but use the existing one. Defaults to False. (Only supported in TypeScript mode)
* **full\_visual\_mode** (bool): When True, browser actions like click, browser\_open, visit\_page, etc. will return 'full visual mode' as snapshot instead of actual page content. The browser\_get\_page\_snapshot method will still return the actual snapshot. Defaults to False. \*\*kwargs: Additional keyword arguments passed to the implementation.

<a id="camel.toolkits.hybrid_browser_toolkit.hybrid_browser_toolkit.HybridBrowserToolkit.__new__" />

### **new**

```python theme={"system"}
def __new__(cls, **kwargs: Any):
```

Create a HybridBrowserToolkit instance with the specified mode.

**Parameters:**

* **mode** (`Literal["typescript", "python"]`): Implementation mode. - 'typescript': Uses WebSocket-based TypeScript implementation - 'python': Uses pure Python Playwright implementation Defaults to "typescript".
* **headless** (bool): Whether to run browser in headless mode. Defaults to True.
* **user\_data\_dir** (Optional\[str]): Directory for user data persistence. Defaults to None.
* **stealth** (bool): Whether to enable stealth mode. Defaults to False.
* **cache\_dir** (str): Directory for caching. Defaults to "tmp/". (default: `"tmp/"`)
* **enabled\_tools** (Optional\[List\[str]]): List of enabled tools. Defaults to None.
* **browser\_log\_to\_file** (bool): Whether to log browser actions to file. Defaults to False.
* **log\_dir** (Optional\[str]): Custom directory path for log files. If None, defaults to "browser\_log". Defaults to None.
* **session\_id** (Optional\[str]): Session identifier. Defaults to None.
* **default\_start\_url** (str): Default URL to start with. Defaults to "[https://google.com/](https://google.com/)".
* **default\_timeout** (Optional\[int]): Default timeout in milliseconds. Defaults to None.
* **short\_timeout** (Optional\[int]): Short timeout in milliseconds. Defaults to None.
* **navigation\_timeout** (Optional\[int]): Navigation timeout in milliseconds. Defaults to None.
* **network\_idle\_timeout** (Optional\[int]): Network idle timeout in milliseconds. Defaults to None.
* **screenshot\_timeout** (Optional\[int]): Screenshot timeout in milliseconds. Defaults to None.
* **page\_stability\_timeout** (Optional\[int]): Page stability timeout in milliseconds. Defaults to None.
* **dom\_content\_loaded\_timeout** (Optional\[int]): DOM content loaded timeout in milliseconds. Defaults to None.
* **viewport\_limit** (bool): Whether to filter page snapshot elements to only those visible in the current viewport. Defaults to False.
* **connect\_over\_cdp** (bool): Whether to connect to an existing browser via Chrome DevTools Protocol. Defaults to False. (Only supported in TypeScript mode)
* **cdp\_url** (Optional\[str]): WebSocket endpoint URL for CDP connection. Required when connect\_over\_cdp is True. Defaults to None. (Only supported in TypeScript mode)
* **cdp\_keep\_current\_page** (bool): When True and using CDP mode, won't create new pages but use the existing one. Defaults to False. (Only supported in TypeScript mode)
* **full\_visual\_mode** (bool): When True, browser actions like click, browser\_open, visit\_page, etc. will return 'full visual mode' as snapshot instead of actual page content. The browser\_get\_page\_snapshot method will still return the actual snapshot. Defaults to False. \*\*kwargs: Additional keyword arguments passed to the implementation.

**Returns:**

HybridBrowserToolkit instance of the specified implementation.
