I have a task to write a component that will receive and embed links when copying a piece of text to protect copyright. Tried to get the data as follows.
function copyHandler(e) { // e.clipboardData.setData("text/plain", e.clipboardData+"hello"); console.log(e.clipboardData.getData('text/plain')); //e.preventDefault(); } document.addEventListener("copy", copyHandler, false); However, whatever I did, the given object. I use the chrome 57 browser. Tell me how to get the text through a variable or array