
正如gengkev在上面的评论中所暗示的那样,似乎最好/唯一的方法是使用异步xhr2调用:
var xhr = new XMLHttpRequest();xhr.open('GET', 'blob:http%3A//your.blob.url.here', true);xhr.responseType = 'blob';xhr.onload = function(e) { if (this.status == 200) { var myBlob = this.response; // myBlob is now the blob that the object URL pointed to. }};xhr.send();更新(2018):对于可以安全使用ES5的情况,Joe在下面提供了一个基于ES5的简单答案。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)