Can you tell me how can I just get text who is copied in clipboard. I don't want to make a copy because data are copied from Excel. In IE I use :
var clipText = window.clipboardData.getData('Text');
And it's work perfect. Is it possible in chrome ? or maybe Firefox ?
Thanks for advance
The window.clipboardData object is only available in IE. It seems like a big security vulnerability to me for a website to be able to access your clipboard data, especially without you knowing. According to the specification, it's mostly deprecated as of Microsoft Edge.
Instead, you can access the data by listening to the paste
event:
document.addEventListener('paste', function (event) {
var clipText = event.clipboardData.getData('Text');
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With