浏览代码

Fix Tools Download on Edge and IE

Sebastien Vandenberghe 7 年之前
父节点
当前提交
1a6812a8f3
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      src/Tools/babylon.tools.ts

+ 5 - 0
src/Tools/babylon.tools.ts

@@ -1121,6 +1121,11 @@
          * @param fileName defines the name of the downloaded file
          * @param fileName defines the name of the downloaded file
          */
          */
         public static Download(blob: Blob, fileName: string): void {
         public static Download(blob: Blob, fileName: string): void {
+            if (navigator && navigator.msSaveBlob) {
+                navigator.msSaveBlob(blob, fileName);
+                return;
+            }
+
             var url = window.URL.createObjectURL(blob);
             var url = window.URL.createObjectURL(blob);
             var a = document.createElement("a");
             var a = document.createElement("a");
             document.body.appendChild(a);
             document.body.appendChild(a);