Get current clipboard content? [closed]
Use the new clipboard API, via navigator.clipboard. It can be used like this: With async/await syntax: const text = await navigator.clipboard.readText(); Or with Promise syntax: navigator.clipboard.readText() .then(text => { console.log(‘Pasted content: ‘, text); }) .catch(err => { console.error(‘Failed to read clipboard contents: ‘, err); }); Keep in mind that this will prompt the user with … Read more