Merge pull request #3468 from yurydelendik/download-refactor

Restoring PR 3455 functionality
This commit is contained in:
Yury Delendik 2013-07-12 15:04:26 -07:00
commit dfaf22f564

View File

@ -75,20 +75,20 @@ var DownloadManager = (function DownloadManagerClosure() {
function DownloadManager() {} function DownloadManager() {}
DownloadManager.prototype = { DownloadManager.prototype = {
downloadUrl: function DownloadManager_downloadUrl(url) { downloadUrl: function DownloadManager_downloadUrl(url, filename) {
FirefoxCom.request('download', { FirefoxCom.request('download', {
originalUrl: url, originalUrl: url,
filename: this.filename filename: filename
}); });
}, },
download: function DownloadManager_download(blob, url) { download: function DownloadManager_download(blob, url, filename) {
var blobUrl = window.URL.createObjectURL(blob); var blobUrl = window.URL.createObjectURL(blob);
FirefoxCom.request('download', { FirefoxCom.request('download', {
blobUrl: blobUrl, blobUrl: blobUrl,
originalUrl: url, originalUrl: url,
filename: this.filename filename: filename
}, },
function response(err) { function response(err) {
if (err && this.onerror) { if (err && this.onerror) {