Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose feature detection. #26

Closed
lgarron opened this issue Jan 10, 2016 · 3 comments
Closed

Expose feature detection. #26

lgarron opened this issue Jan 10, 2016 · 3 comments

Comments

@lgarron
Copy link
Owner

lgarron commented Jan 10, 2016

See issues #23 and #25. Where possible, it would be nice to detect ahead of time which of the following will work, and expose an API to query it. In response, a developer could e.g. use a Flash fallback only when necessary.

  • Plain text copying
  • Rich text copying
  • Pasting

Since a successful copy/paste has a user-visible side effect, it would be nice to avoid triggering them unless you actually want to perform the action.

@lgarron
Copy link
Owner Author

lgarron commented Mar 10, 2016

It seems document.queryCommandSupported("copy") will get us most of the way there.

@lgarron
Copy link
Owner Author

lgarron commented Jul 27, 2020

There isn't a great way to do this on older browsers, where copying is best-effort.

For new browsers, this is now covered by the following issue in the spec: w3c/clipboard-apis#67

I'd prefer not to add feature detection that should go in the API itself.

@lgarron
Copy link
Owner Author

lgarron commented Aug 20, 2020

Closing in favor of the spec issue.

@lgarron lgarron closed this as completed Aug 20, 2020
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

No branches or pull requests

1 participant