Skip to content

Conversation

@schickling
Copy link
Contributor

Summary

  • add feature detection before instantiating ClipboardItem
  • fall back to navigator.clipboard.writeText for browsers that do not expose the constructor (e.g. Firefox/Safari)
  • keep existing behaviour for browsers that support ClipboardItem

Testing

  • Verified the Copy Page button in a local Starlight site on Firefox 130

@reynaldichernando
Copy link
Member

thanks for the PR!
please give me some time to test this, since i don't have firefox installed, plus to make sure it doesn't break on other browser

safari is notoriously hard to do copy to clipboard

@reynaldichernando
Copy link
Member

quick update on the PR: this breaks copy in safari
let me have a look on how to do this properly while still supporting the navigator fallback

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.

2 participants