Created
March 2, 2019 21:45
-
-
Save neotam/3d733b653c2d0f247ce31d66f4c344f3 to your computer and use it in GitHub Desktop.
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
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