mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-23 20:23:00 +00:00
feat(tools-browser): set_default_browser / use_browser actions for v1.9.0 bridge
The extension's bridge server (cdp-bridge-server.ts v1.9.0) added two new actions for dynamic browser switching: set_default_browser — persist a default-target browser use_browser — alias of set_default_browser Both accept the browser name (firefox / chrome / safari / edge or a specific instance ID like 'firefox-2') as the 'browser' field. The bridge writes the choice to ~/.hanzo/extension/config.json so it survives bridge restarts. This commit: - Adds the two action names to the Action Literal so the MCP tool accepts them. - Adds them to extension_actions so they route through the bridge rather than falling to Playwright. - The 'target_browser' parameter (already exposed) carries the browser name through to the bridge as 'browser', which is exactly what set_default_browser expects. Bumps hanzo-tools-browser 0.4.5 → 0.4.6.
This commit is contained in:
@@ -394,6 +394,8 @@ Action = Annotated[
|
||||
"tabs", # list/switch tabs
|
||||
"select_tab", # bring a specific tab to focus (Target.activateTarget)
|
||||
"list_browsers", # list every connected extension provider
|
||||
"set_default_browser", # persist the bridge's default browser pick
|
||||
"use_browser", # alias of set_default_browser
|
||||
"connect", # connect via CDP
|
||||
"set_headless", # toggle headless/headed
|
||||
"status", # get browser status
|
||||
@@ -884,6 +886,10 @@ CATEGORIES:
|
||||
"inject_script", "inject_css",
|
||||
"local_storage", "cookies",
|
||||
"tabs", "new_tab", "select_tab",
|
||||
# Multi-browser routing (bridge v1.9.0+) — list connected
|
||||
# providers and persist a default-browser pick. Without one
|
||||
# the bridge auto-prefers firefox > safari > edge > chrome.
|
||||
"list_browsers", "browsers", "set_default_browser", "use_browser",
|
||||
"console", "network_requests", "status",
|
||||
# Takeover actions (Phase 3)
|
||||
"takeover", "release",
|
||||
|
||||
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "hanzo-tools-browser"
|
||||
version = "0.4.5"
|
||||
version = "0.4.6"
|
||||
description = "Browser automation tools with extension-first routing - uses Hanzo browser extension when available, Playwright as fallback"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.12"
|
||||
|
||||
Reference in New Issue
Block a user