The current implementation of the copy to clipboard is to create a textarea and use document.execCommand('copy') to copy the text, which is deprecated and strange. The Clipboard API is more modern and supports copying with more MIME types (like images and html). This enables extending the current copy to clipboard function to copy different types of data.
The downside of this attempt is that it requires browser released after 2020. So it is not capable with older browsers.
The current implementation of the copy to clipboard is to create a textarea and use
document.execCommand('copy')
to copy the text, which is deprecated and strange. The Clipboard API is more modern and supports copying with more MIME types (like images and html). This enables extending the current copy to clipboard function to copy different types of data.The downside of this attempt is that it requires browser released after 2020. So it is not capable with older browsers.