Files
2026-11-22 17:22:50 -08:00

17 lines
541 B
Python

import asyncio
from typing import Any, Dict
from tools.utils import ToolError
async def handle(args: Dict[str, Any], bridge: Any) -> list:
"""
Opens a new Firefox window with the specified URL.
"""
url = args.get("url")
if not url:
raise ToolError("Missing required argument: 'url'")
request_id = f"req_{asyncio.get_event_loop().time()}_{id(args)}"
await bridge.send_to_extension(request_id, "open_new_window", {"url": str(url)})
return [{"type": "text", "text": f"Opened new window with {url}."}]