Skip to content

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

fix Selenium wss:// handling and webhook JSON parse guard

ShawnPana318eb3b41e40
diff --git a/skills/cloud/references/browser-api.md b/skills/cloud/references/browser-api.md
index fbfd9ef35..c8ec6ac6c 100644
--- a/skills/cloud/references/browser-api.md
+++ b/skills/cloud/references/browser-api.md
@@ -105,7 +105,7 @@ from selenium.webdriver.chrome.options import Options
browser_session = await client.browsers.create(proxy_country_code="us")
options = Options()
-options.debugger_address = browser_session.cdp_url.replace("ws://", "").replace("/devtools/browser/", "")
+options.debugger_address = browser_session.cdp_url.replace("wss://", "").replace("ws://", "").replace("/devtools/browser/", "")
driver = webdriver.Chrome(options=options)
driver.get("https://example.com")
diff --git a/skills/cloud/references/features.md b/skills/cloud/references/features.md
index bc4109d92..55a1a4a5f 100644
--- a/skills/cloud/references/features.md
+++ b/skills/cloud/references/features.md
@@ -88,7 +88,10 @@ def verify_webhook(body: bytes, signature: str, timestamp: str, secret: str) ->
return False
if abs(time.time() - ts) > 300:
return False
- payload = json.loads(body)
+ try:
+ payload = json.loads(body)
+ except (json.JSONDecodeError, ValueError):
+ return False
message = f"{timestamp}.{json.dumps(payload, separators=(',', ':'), sort_keys=True)}"
expected = hmac.new(secret.encode(), message.encode(), hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, signature)