Skip to content

Conversation

njhale
Copy link
Member

@njhale njhale commented Jul 18, 2025

navigator.clipboard is unavailable in insecure contexts (like
non-localhost http). This results in the copy button not working.

Detect this scenario and disable the copy button.

Addresses #3433

Note: I'm not sure this is actually how we want to handle this. I can
try another method to make this work in these contexts, but wanted to
gather feedback on this approach first.

`navigator.clipboard` is unavailable in insecure contexts (like
non-localhost http). This results in the copy button not working.

Detect this scenario and disable the copy button.

Addresses obot-platform#3433

Note: I'm not sure this is actually how we want to handle this. I can
try another method to make this work in these contexts, but wanted to
gather feedback on this approach first.

Signed-off-by: Nick Hale <[email protected]>
Copy link
Contributor

@ivyjeong13 ivyjeong13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like navigator.clipboard is appropriate, https://developer.mozilla.org/en-US/docs/Web/API/Navigator/clipboard says it's only available in secure contexts. Was wondering are there cases where we would want to avoid copying in a secure context?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants