Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.
Python ai-agentsai-toolsbrowser-agentbrowser-automationbrowser-usecdpcloud-browsercomputer-useheadless-browserllmmcpplaywrightpythonremote-browserstealth-browserweb-automationweb-scraping
Option to exclude actions
magmuellerf59dade4b3ba
diff --git a/browser_use/controller/registry/service.py b/browser_use/controller/registry/service.pyindex 9d7355255..ab62513c7 100644--- a/browser_use/controller/registry/service.py+++ b/browser_use/controller/registry/service.py@@ -20,9 +20,10 @@ from browser_use.telemetry.views import (class Registry:"""Service for registering and managing actions"""- def __init__(self):+ def __init__(self, exclude_actions: list[str] = []):self.registry = ActionRegistry()self.telemetry = ProductTelemetry()+ self.exclude_actions = exclude_actionsdef _create_param_model(self, function: Callable) -> Type[BaseModel]:"""Creates a Pydantic model from function signature"""@@ -48,6 +49,10 @@ class Registry:"""Decorator for registering actions"""def decorator(func: Callable):+ # Skip registration if action is in exclude_actions+ if func.__name__ in self.exclude_actions:+ return func+# Create param model from function if not providedactual_param_model = param_model or self._create_param_model(func)diff --git a/browser_use/controller/service.py b/browser_use/controller/service.pyindex c8cca2638..a1eeeccc2 100644--- a/browser_use/controller/service.py+++ b/browser_use/controller/service.py@@ -28,8 +28,10 @@ logger = logging.getLogger(__name__)class Controller:def __init__(self,+ exclude_actions: list[str] = [],):- self.registry = Registry()+ self.exclude_actions = exclude_actions+ self.registry = Registry(exclude_actions)self._register_default_actions()def _register_default_actions(self):