Adding text/plain and 'text/plain;charset=ISO-8859-1': mime type data in DataTransfer in resulting in two items where as it is adding as one in Chrome and Safari
Categories
(Core :: DOM: Copy & Paste and Drag & Drop, defect)
Tracking
()
People
(Reporter: vissu_nbkr, Unassigned)
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15
Steps to reproduce:
Running following code produce the length as 8 in firefox but in chrome and safari has only 1 element.
dataTransfer = new DataTransfer();
[ ["text/plain" ,1 ],
["text/plain;charset=iso-8859-1", 2],
["text/plain;charset=us-ascii", 3],
["text/plain;charset=utf-16", 4],
["text/plain;charset=utf-16be", 5],
["text/plain;charset=utf-16le", 6],
["text/plain;charset=utf-8", 7],
["text/plain;charset=unicode",8 ]
].forEach(item=>dataTransfer.setData(item[0],item[1]));
console.log(dataTransfer.types.length)
Actual results:
8
Expected results:
1
Hello, thank you for the bug report!
Managed to reproduce this issue on:
- Firefox 115.0;
- Nightly 116.0a1;
Tested and reproduced on:
- Windows 10;
- macOS 12;
- Ubuntu 22;
Moving the Product to ‘DevTools’ and the Component to ' Console’. Please change if there’s a better fit, thank you.
Setting as NEW so the developers can have a look.
Comment 2•2 years ago
|
||
Not a DevTools bug, this can be reproduced on data:text/html,<meta charset=utf8><output></output><script>x = new DataTransfer(); x.setData("text/plain",1); x.setData("text/plain;charset=utf-16",2);document.querySelector("output").innerText = x.types.join("\n")</script> , without opening DevTools
Updated•2 years ago
|
Description
•