fix(browser): preserve non-http schemes in navigate URL

This commit is contained in:
zhayujie
2026-05-27 18:42:21 +08:00
parent 116fb27257
commit 83cd6ad158

View File

@@ -145,7 +145,8 @@ class BrowserTool(BaseTool):
url = args.get("url", "").strip()
if not url:
return ToolResult.fail("Error: 'url' is required for navigate action")
if not url.startswith(("http://", "https://")):
# Only auto-prepend https:// for bare hosts; preserve file://, about:, data:, etc.
if "://" not in url and not url.startswith(("about:", "data:")):
url = "https://" + url
timeout = args.get("timeout", 30000)
service = self._get_service()