fengyuanchen / cropper

⚠️ [Deprecated] No longer maintained, please use https://github.com/fengyuanchen/jquery-cropper
MIT License
7.75k stars 1.74k forks source link

Safari 5.1 have issue with URL.createObjectURL #924

Closed Nimesh-Soni closed 7 years ago

Nimesh-Soni commented 7 years ago

In safari 5.1, URL.createObjectURL(e.target.files[0]) is not working. also try

1)

if (window.URL !== undefined) { var url = window.URL.createObjectURL(e.target.files[0]); } else if (window.webkitURL !== undefined) { var url = window.webkitURL.createObjectURL(e.target.files[0]); } else { console.log('Method Unavailable: createObjectURL'); }

And 2)

var createObjectURL = (window.URL || window.webkitURL || {}).createObjectURL || function(){};

acjh commented 7 years ago

webkitURL.createObjectURL() is only available in Safari 6. URL.createObjectURL() is only available from Safari 7.

See: https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL#Browser_compatibility