sudodoki / copy-to-clipboard

Copy stuff into clipboard from your browser using JS
http://sudodoki.github.io/copy-to-clipboard/example/
MIT License
1.28k stars 132 forks source link

fix: clearData with format to fix only can set one format clipboard data bug #141

Closed HellowVirgil closed 1 month ago

HellowVirgil commented 1 month ago

In this case, only text/html format can be set:

copyToClipboard(url, {
  format: 'text/plain',
});
copyToClipboard(`<a href="${url}">aaa</a>`, {
  format: 'text/html',
});

because the clipboardData has been cleaned when called each time.