I\'ve created an image from my canvas object by using canvas.toDataURL(\"image/png\", 0.7). It works fine to save the image from the context menu but it doesn\'
canvas.toDataURL(\"image/png\", 0.7)
Much easier 1 liner: Assuming u have a canvas. The following code will copy the canvas (as blob --> PNG image) to your clipboard.
canvas.toBlob(blob => navigator.clipboard.write([new ClipboardItem({'image/png': blob})]));