From 3fcdb17d08a5a10cbcb5750023cb56e272abb7ae Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Wed, 19 Nov 2014 18:01:03 +0300 Subject: [PATCH] Fixed Chrome file download --- app/js/lib/ng_utils.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/js/lib/ng_utils.js b/app/js/lib/ng_utils.js index db20de35..aa0c4638 100644 --- a/app/js/lib/ng_utils.js +++ b/app/js/lib/ng_utils.js @@ -49,7 +49,8 @@ angular.module('izhukov.utils', []) $window.URL = $window.URL || $window.webkitURL; $window.BlobBuilder = $window.BlobBuilder || $window.WebKitBlobBuilder || $window.MozBlobBuilder; - var buggyUnknownBlob = navigator.userAgent.indexOf('Safari') != -1; + var buggyUnknownBlob = navigator.userAgent.indexOf('Safari') != -1 && + !navigator.userAgent.indexOf('Chrome') == -1; var blobSupported = true; @@ -199,7 +200,7 @@ angular.module('izhukov.utils', []) } function getFileCorrectUrl(blob, mimeType) { - if (buggyUnknownBlob) { + if (buggyUnknownBlob && blob instanceof Blob) { var mimeType = blob.type || blob.mimeType || mimeType || ''; if (!mimeType.match(/image\/(jpeg|gif|png|bmp)|video\/quicktime/)) { return getDataUrl(blob);