diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2015-03-07 01:18:32 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2015-03-07 01:18:32 +0300 |
commit | d769be82dd052a4d963321e7b6d592d15e5f1395 (patch) | |
tree | ff75d22c52344cd626a7430826eb499739a6d22f /lib/storage.js | |
parent | d28fad14a5713acfcd6b3a4e85beccd51d4c7836 (diff) |
file.getBlobURL requires window.URL window.Blob support
Diffstat (limited to 'lib/storage.js')
-rw-r--r-- | lib/storage.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/storage.js b/lib/storage.js index 3721fe4..48d88a1 100644 --- a/lib/storage.js +++ b/lib/storage.js @@ -275,9 +275,12 @@ File.prototype.createReadStream = function (opts) { */ File.prototype.getBlobURL = function (cb) { var self = this + if (global.URL === undefined || global.Blob === undefined) { + return cb(new Error('file.getBlobURL requires window.URL window.Blob support')) + } self.getBuffer(function (err, buf) { if (err) return cb(err) - var url = URL.createObjectURL(new Blob([ buf ])) + var url = global.URL.createObjectURL(new global.Blob([ buf ])) cb(null, url) }) } |