Created
April 7, 2021 14:39
-
-
Save fnnzzz/e8d9e828307f7150e202302f8f13616f to your computer and use it in GitHub Desktop.
clipboard cv estaff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener('copy', async function(e) { | |
try { | |
const clipboardItems = await navigator.clipboard.read(); | |
for (const clipboardItem of clipboardItems) { | |
for (const type of clipboardItem.types) { | |
const blob = await clipboardItem.getType(type); | |
console.log(await blob.text()) | |
} | |
} | |
} catch (err) { | |
console.error(err.name, err.message); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment