I am working on an application where I want to provide a copy button for svg to be copied as an image to clipboard which can be pasted at other places.
I tried using clipboard API but it has a lot of security restrictions, moreover it does not seem to work on http and works with png only.
I also tried the document.execCommand('copy') by creating a div with the image but it worked for me only in MS Word but not in slack or stack overflow (not sure why).
I want to replicate the behaviour of chrome/firefox's right click context-menu's Copy Image option via Javascript.
Is there some way this is possible? I am open to all ideas. Thanks!