Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Safari image.onload event not firing with Blob url

I am trying to get this demo from MDN working in Safari. It works quite nicely in Chrome and FF.

Specifically, the onload callback of the image does not appear to be firing in Safari 7.0.3. Here's a jsfiddle that demonstrates this behavior (run it with the dev console in your browser open):

http://jsfiddle.net/qrohlf/HGFZ4/1/

I think that this is probably a bug in Safari - any ideas on how to work around it?

like image 340
QRohlf Avatar asked Apr 16 '14 16:04

QRohlf


1 Answers

In your jsfiddle example, the onload event is not fired because an error has occurred. Try attach an onerror handler and you will see it fired.

Unfortunately, the error object doesn't tell you what is wrong.

Indeed the problem is the Blob's type doesn't expect the charset part. Try removing ;charset=utf-8 and it will work.

like image 73
Alan Tam Avatar answered Sep 24 '22 07:09

Alan Tam