Skip to content

Instantly share code, notes, and snippets.

@titusfx
Created August 4, 2021 13:36
Show Gist options
  • Save titusfx/08d3a3ceaef1d8cd980f99e83311d57d to your computer and use it in GitHub Desktop.
Save titusfx/08d3a3ceaef1d8cd980f99e83311d57d to your computer and use it in GitHub Desktop.
Paste te Result of your clipboard on a console.
/*
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