Clipboard setData Chrome limit
Hi
Many years ago I developed an application that allows the users to copy data in the form of html to allow the user to easily paste data in other applications such as Excel.
However, I have received complaints that this is not working in Chrome and after some testing I have discovered that there is a limitation to 1 million characters when copying from the application using Chrome. It is working fine in IE as well as for smaller strings in Chrome.
Code to replicate the error...
var str:String = "";
for(var i:uint = 0; i < 1000001; i++)
str += "X";
trace(str.length)
try {
Clipboard.generalClipboard.clear();
var clipboardSuccess:Boolean = Clipboard.generalClipboard.setData(ClipboardFormats.HTML_FORMAT,str);
trace("setClipboard " + clipboardSuccess)
} catch (e:Error) {
trace("Error setClipboard " + e);
}
Obviously the code has to run in a button event. It is always working in IE and also in Chrome if the string is 1000000 or shorter.
Clipboard.generalClipboard.setData always returns true (success) and is never throwing any error.
System.setClipboard is the same.
Any workarounds? Is this a general Chrome limitation or something the Chrome Flash player?
