Fix clipboard copy on insecure origins - #1589
Open
Willhong wants to merge 1 commit into
Open
Conversation
Willhong
marked this pull request as ready for review
August 14, 2026 05:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root cause
bb can be opened over a plain-HTTP LAN origin, while
navigator.clipboard.writeText()is restricted to secure contexts in browsers. The shared copy helper treated an unavailable or rejected Clipboard API as a terminal failure, so every copy affordance backed by that helper displayedFailed to copyon those origins.User impact
Copy actions now continue to use the modern Clipboard API on secure origins and retain a user-gesture fallback for LAN HTTP access. A failure toast is shown only when both strategies fail.
Fixes #1590
Validation
pnpm exec turbo run typecheck --filter=@bb/app --forcepnpm exec turbo run lint --filter=@bb/app --force(0 errors; existing warnings remain)pnpm exec vitest run --config vitest.config.ts src/lib/clipboard.test.ts(5 passed)@bb/apptest run: 2,709 passed; one unrelated iPadOS typeahead test failed once and passed when rerun in isolation