diff --git a/js/views/attachment_view.js b/js/views/attachment_view.js index 59f396d1329a..e95e62f62604 100644 --- a/js/views/attachment_view.js +++ b/js/views/attachment_view.js @@ -172,22 +172,10 @@ return suggestion; }, saveFile: function() { - var blob = this.blob; - var w = extension.windows.getViews()[0]; - if (w && w.chrome && w.chrome.fileSystem) { - w.chrome.fileSystem.chooseEntry({ - type: 'saveFile', suggestedName: this.suggestedName() - }, function(entry) { - if (!entry) { - return; - } - entry.createWriter(function(fileWriter) { - fileWriter.write(blob); - }); - }); - } else { - console.log('Failed to get window'); - } + var url = window.URL.createObjectURL(this.blob, { type: 'octet/stream' }); + var a = $('').attr({ href: url, download: this.suggestedName() }); + a[0].click(); + window.URL.revokeObjectURL(url); }, render: function() { if (!this.isImage()) {