Fix sidechat CDP and button selectors\n\n- sidechat_manager._ev: use id=1 and returnByValue to match ev()\n- cmd_sidechat_create: find + button via Side chats header proximity\n- cmd_sidechat_create: use cmd_send for initial message (not DOM hack)\n- Integrate ensure_sidebar with retry
This commit is contained in:
@@ -15,13 +15,13 @@ import json
|
||||
|
||||
def _ev(ws, js, await_result=True):
|
||||
"""Evaluate JS via CDP, return result.
|
||||
Uses id=1 to match muse-chat-api.py's ev() on shared websocket.
|
||||
Fixed 2026-10-04: was using id=100, causing response mismatch.
|
||||
Matches muse-chat-api.py's ev() exactly (id=1, returnByValue).
|
||||
Fixed 2026-10-04: was using id=100, missing returnByValue.
|
||||
"""
|
||||
import json as _json
|
||||
ws.send(_json.dumps({
|
||||
"id": 1, "method": "Runtime.evaluate",
|
||||
"params": {"expression": js, "awaitPromise": True}
|
||||
"params": {"expression": js, "returnByValue": True, "awaitPromise": await_result}
|
||||
}))
|
||||
resp = _json.loads(ws.recv())
|
||||
result = resp.get("result", {}).get("result", {})
|
||||
|
||||
Reference in New Issue
Block a user