-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
Browser support? #60
Comments
Sure, but only the async APIs can be supported. It should use the Async Clipboard API. Not interested in any fallback for older browsers. See https://nodejs.org/api/esm.html#esm_conditional_exports on how to add the browser version. |
@sindresorhus In that case, how do we handle calls to writeSync and readSync when running in the browser if we want a 1:1 interface? |
We would just document that those don't work in the browser. |
@sindresorhus The latest version of browserify can't seem to recognise the browser field. Do you have an example in another one of your packages? |
We can use
document.execCommand
or the Async Clipboard API to create a 1:1 implementation for browsers.See: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Interact_with_the_clipboard
cc @sindresorhus
The text was updated successfully, but these errors were encountered: