mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-22 18:38:12 +00:00
The async Clipboard API is only available in secure contexts (HTTPS or localhost). On plain-HTTP deployments navigator.clipboard is undefined, so the code block copy button threw synchronously and silently failed. Add a shared copyToClipboard helper that guards the secure-context path and falls back to the legacy execCommand copy, reuse it for the code block button and the copy-as- markdown affordance, and cover it with a unit test plus a real-browser e2e that simulates the non-secure context. Fixes #93628 Co-authored-by: Pick-cat <266665499+Pick-cat@users.noreply.github.com>