Skip to content

Clipboard copy actions fail on plain-HTTP LAN origins #1590

Description

@Willhong

Description

Copy actions backed by the shared clipboard helper fail when bb is opened from another device over a plain-HTTP LAN URL, such as http://<host>:38886. Clicking a copy affordance shows Failed to copy and leaves the clipboard unchanged.

Reproduction

  1. Run bb so the frontend is reachable from the local network.
  2. Open it from another device using a non-loopback HTTP origin.
  3. Click any copy action backed by the shared clipboard helper, such as a path or message copy button.

Expected behavior

The selected text is copied to the system clipboard.

Actual behavior

The copy fails and bb displays Failed to copy.

Root cause

Browsers restrict navigator.clipboard.writeText() to secure contexts. A plain-HTTP LAN origin is not considered secure, so the Clipboard API may be unavailable or reject the request. The shared helper currently treats that as a terminal failure even though bb supports this access pattern.

Impact

Because copy affordances share the helper, this affects multiple copy actions throughout the app rather than one specific component.

Proposed fix

Retain the modern Clipboard API on secure origins and fall back to a temporary textarea plus the browser editing copy command when the API is unavailable or rejects. Restore focus and selection after the attempt.

Draft implementation: #1589

AGENT GENERATED: by GPT-5.6 Sol

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-reproBug reproduced independently; see linked reportremoteMulti-device, LAN/tailnet access, notifications

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions