Closed paulpdaniels closed 11 years ago
Edit: Tracked down the issue to this line (105):
bb.push(String.fromCharCode.apply(String, new Uint8Array(data)));
It appears that on Safari iOS this function calls recursively for some reason.
Also noticed that the alternative case
var
str = ""
, buf = new Uint8Array(data)
, i = 0
, buf_len = buf.length
;
for (; i < buf_len; i++) {
str += String.fromCharCode(buf[i]);
}
Doesn't appear to be doing anything.
I'm having exactly the same problem with desktop OS X 10.8.3, Safari 6.0.4.
@paulpdaniels I will accept any pull requests tested to work in IE10/Chrome/Firefox/Safari 6 if you have a solution.
I got the same problem in win7 /safari 5.1.7 when to save a canvas which size is bigger than some value.
The demo is fine.
We ran into this bug too, and found that this happens when the data is too large. Here is a fix for Blob.js: replace this line (around line 105) bb.push(String.fromCharCode.apply(String, new Uint8Array(data)));
with this: var str = "", array = new Uint8Array(data); for (var i = 0, len = array.length; i < len; i++) { str += String.fromCharCode(array[i]); } bb.push(str);
Have fun!
Did this fix it for you?
I could only check this on Safari, Win7. There the fix working very well.
Works on OSX 10.8.4.
yes,it did.
Eli Grey notifications@github.com wrote:
Did this fix it for you?
— Reply to this email directly or view it on GitHub.
also works for ipad.
David Karacsony notifications@github.com wrote:
I could only check this on Safari, Win7. There the fix working very well.
— Reply to this email directly or view it on GitHub.
Just for completeness, it is not a recursion problem, but String.fromCharCode.apply() will push each element of the array to the arguments. The arguments are passed via the stack. So the maximum call stack size is exceeded with one single call
For future reference, the behavior observed here is basically https://bugs.webkit.org/show_bug.cgi?id=80797.
When attempting to use Blob.js in Safari for iOS using the Blob constructor results in a "Maximum call stack size exceeded" exception.
Seen on iOS 6.1.3 and 5.1.1