copy-to-clipboard icon indicating copy to clipboard operation
copy-to-clipboard copied to clipboard

Copy stuff into clipboard from your browser using JS

Results 50 copy-to-clipboard issues
Sort by recently updated
recently updated
newest added

As of early 2020, the `execCommand` feature [is now obsolete](https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand) :( The best next alternative seems to be[ on the DOM `navigator` object](https://stackoverflow.com/questions/400212/how-do-i-copy-to-the-clipboard-in-javascript) which is [well-supported across browsers](https://caniuse.com/mdn-api_navigator_clipboard) but requires...

It seems that the click handler cannot load data? or do other pre-processing? Example: https://codesandbox.io/s/ecstatic-chaplygin-enmpd?file=/src/App.js

in ie11 ``` copy('test', { format: 'text/plain', }); ``` results in ```test``` being copied to clipboard and pasted into ms-word ``` copy('test', { format: 'text/html', }); ``` results in empty...

help wanted

when a dom fullscreen, copy is expired,because the span element is append to the document.body, so i hope add the options.el config

for this code fragment, Is it necessary for other browser to check options.format ? I config wrong with `format: 'plain'` , and then nothing could paste. ``` if (typeof e.clipboardData...

As suggested by @shvaikalesh in #3, just considering this a separate issue. Also, messages like "double tap and choose copy" can be displayed on handheld devices. Furthermore, it is possible...

help wanted

Merging ranges is deprecated for a while now https://www.chromestatus.com/features/6680566019653632. Removing all ranges before adding was suggested in https://stackoverflow.com/a/43443101.

Multiline text gets pasted as single line on mobile. Tested with both Chrome on Android and Safari on iOS