浏览代码

Blob supported on modern browsers

László Matuska, BitOfGold 10 年之前
父节点
当前提交
a37117bf1d
共有 2 个文件被更改,包括 1 次插入18 次删除
  1. 1 9
      src/Tools/babylon.tools.ts
  2. 0 9
      src/babylon.mixins.ts

+ 1 - 9
src/Tools/babylon.tools.ts

@@ -343,15 +343,7 @@
 
 
         //returns a downloadable url to a file content.
         //returns a downloadable url to a file content.
         public static FileAsURL(content:string): string {
         public static FileAsURL(content:string): string {
-            var fileBlob;
-            try {
-                fileBlob = new Blob([content]);
-            } catch(e) {
-                var blobBuilder = window.BlobBuilder || window.MozBlobBuilder || window.WebKitBlobBuilder;
-                var bb = new blobBuilder();
-                bb.append([content]);
-                fileBlob = bb.getBlob();
-            }
+            var fileBlob = new Blob([content]);
             var url = window.URL || window.webkitURL;
             var url = window.URL || window.webkitURL;
             var link:string = url.createObjectURL(fileBlob);
             var link:string = url.createObjectURL(fileBlob);
             return link;
             return link;

+ 0 - 9
src/babylon.mixins.ts

@@ -18,21 +18,12 @@ interface Window {
     SIMD: any;
     SIMD: any;
     AudioContext: AudioContext;
     AudioContext: AudioContext;
     webkitAudioContext: AudioContext;
     webkitAudioContext: AudioContext;
-    BlobBuilder: HTMLBLOBBUILDER;
-    MozBlobBuilder: HTMLBLOBBUILDER;
-    WebKitBlobBuilder: HTMLBLOBBUILDER;
 }
 }
 
 
 interface HTMLURL {
 interface HTMLURL {
     createObjectURL(param1: any, param2?: any);
     createObjectURL(param1: any, param2?: any);
 }
 }
 
 
-interface HTMLBLOBBUILDER {
-    new(): HTMLBLOBBUILDER;
-    append(param1: any);
-    getBlob();
-}
-
 interface Document {
 interface Document {
     exitFullscreen(): void;
     exitFullscreen(): void;
     webkitCancelFullScreen(): void;
     webkitCancelFullScreen(): void;