Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neotam/3d733b653c2d0f247ce31d66f4c344f3 to your computer and use it in GitHub Desktop.
Save neotam/3d733b653c2d0f247ce31d66f4c344f3 to your computer and use it in GitHub Desktop.
function readFromClipboard() {
return navigator.clipboard.readText().then(
result => {
console.log("Successfully retrieved text from clipboard", result)
return Promise.resolve(result);
}
)
.catch(
err => {
console.log("Error! read text from clipbaord", err)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment