So this is how I extract the copied text from clipboard:
const data = event.clipboardData.getData('text/html');
But this code does not work if I copied a URL. The data will be "" empty. Not sure why is it different with a normal text.
How do I get the copied URL?
EDIT
The event I got is from paste event:
paste(event: ClipboardEvent) {
const data = event.clipboardData.getData('text/html');
}
From this HTML element (I am using Angular):
<div
id="content"
contentEditable="true"
(paste)="paste($event)"
></div>