Open new window
This commit is contained in:
1 parent
52ddc6ba9a
commit
2873da3c84
3 files changed
+38
No files matched your search
@@ -0,0 +1,16 @@
|
||||
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}."}]
|
||||
Reference in new issue
Block a user