agent-zero/plugins/_browser/api/extensions.py
Alessandro 983d431a5e browser: replace browser-use agent with native browser
Introduce the new built-in Browser plugin for Agent Zero, replacing the legacy
browser-use-based browser agent with a direct Playwright-powered browser tool,
live WebUI viewer, browser session controls, status APIs, configuration, and
extension-management support.

Add browser-specific modal behavior so the browser can run as a floating,
resizable, no-backdrop window, including modal focus, toggle, and idempotent
open helpers for richer WebUI surfaces.

Remove the old `_browser_agent` core plugin and the `browser-use` dependency,
then clean up stale browser-model wiring and references across agent code,
model configuration docs, setup guides, troubleshooting docs, skills, and
Agent Zero knowledge.

Update regression and WebUI extension-surface coverage for the new browser
architecture and modal behavior.

The legacy browser-use implementation has been extracted from core so it can
continue separately as a community plugin published through the A0 Plugin Index for any user or professional that were relying on it for workflow.
2026-04-24 15:43:52 +02:00

27 lines
879 B
Python

from helpers.api import ApiHandler, Request
from plugins._browser.helpers.extension_manager import (
get_extensions_root,
install_chrome_web_store_extension,
list_browser_extensions,
)
class Extensions(ApiHandler):
async def process(self, input: dict, request: Request) -> dict:
action = input.get("action", "list")
if action == "list":
return {
"ok": True,
"root": str(get_extensions_root()),
"extensions": list_browser_extensions(),
}
if action == "install_web_store":
try:
result = install_chrome_web_store_extension(str(input.get("url", "")))
except ValueError as exc:
return {"ok": False, "error": str(exc)}
return result
return {"ok": False, "error": f"Unknown action: {action}"}