Created
August 4, 2021 13:36
-
-
Save titusfx/08d3a3ceaef1d8cd980f99e83311d57d to your computer and use it in GitHub Desktop.
Paste te Result of your clipboard on a console.
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
/* | |
Paste te Result of your clipboard on a console. | |
In background.js of a chrome extension and permission of clipboardRead and clipboardWrite on the manifest | |
*/ | |
setInterval(()=>{ | |
let tempT = document.querySelector('#clipboard'); | |
let textArea = !!tempT ? tempT : document.createElement("textarea"); | |
textArea.id = 'clipboard' | |
document.body.appendChild(textArea); | |
textArea.select(); | |
document.execCommand("Paste"); | |
console.log(textArea.value); | |
}, 1000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment