Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

fix

mertunsall375bc6a28350
diff --git a/browser_use/browser/watchdogs/security_watchdog.py b/browser_use/browser/watchdogs/security_watchdog.py
index 343ab947e..f95a26260 100644
--- a/browser_use/browser/watchdogs/security_watchdog.py
+++ b/browser_use/browser/watchdogs/security_watchdog.py
@@ -252,9 +252,8 @@ class SecurityWatchdog(BaseWatchdog):
if scheme in ['http', 'https']:
return True
elif pattern.endswith('/*'):
- # Pattern like brave://* should match any brave:// URL
- prefix = pattern[:-1] # Remove the * at the end
- if url.startswith(prefix):
+ # Pattern like brave://* or http*://example.com/*
+ if fnmatch.fnmatch(url, pattern):
return True
else:
# Use fnmatch for other glob patterns