clipboardData.getData is broken completely and useless
Reported by
labobol...@gmail.com,
Feb 10 2017
|
||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
Steps to reproduce the problem:
1. Run the code below in on any site with text.
2. Copy some text.
3. Look at the console.
What is the expected behavior?
clipboardData.getData('text') should return text
What went wrong?
clipboardData.getData('text') returns nothing
Did this work before? N/A
Does this work in other browsers? N/A
Chrome version: 56.0.2924.87 Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version: Shockwave Flash 24.0 r0
Test code, run it on any site with text:
document.addEventListener('copy', function (e) {
console.log(e.clipboardData.getData('string'));
console.log(e.clipboardData.getData('text'));
console.log(e.clipboardData.getData('text/plain'));
console.log(e.clipboardData.getData('text/html'));
console.log(e.clipboardData.getData('url'));
console.log(e.clipboardData.getData('text/uri-list'));
var items = e.clipboardData.items;
if (items) {
for (var i = 0; i < items.length; i++) {
console.log(items[i].type, items[i]);
}
}
});
I want to format the selected text on a site that isn't copy-text-friendly, I've had it with manually fixing the text afterwards in my text editor. Disappointingly but expected, nothing works in Chrome.
,
Feb 10 2017
|
||
►
Sign in to add a comment |
||
Comment 1 by sigbjo...@opera.com
, Feb 10 2017