|
1 | 1 | /* FileSaver.js
|
2 | 2 | * A saveAs() FileSaver implementation.
|
3 |
| - * 2014-08-29 |
| 3 | + * 2015-01-04 |
4 | 4 | *
|
5 | 5 | * By Eli Grey, http://eligrey.com
|
6 | 6 | * License: X11/MIT
|
@@ -49,9 +49,10 @@ var saveAs = saveAs
|
49 | 49 | }
|
50 | 50 | , force_saveable_type = "application/octet-stream"
|
51 | 51 | , fs_min_size = 0
|
52 |
| - // See https://code.google.com/p/chromium/issues/detail?id=375297#c7 for |
53 |
| - // the reasoning behind the timeout and revocation flow |
54 |
| - , arbitrary_revoke_timeout = 10 |
| 52 | + // See https://code.google.com/p/chromium/issues/detail?id=375297#c7 and |
| 53 | + // https://github.com/eligrey/FileSaver.js/commit/485930a#commitcomment-8768047 |
| 54 | + // for the reasoning behind the timeout and revocation flow |
| 55 | + , arbitrary_revoke_timeout = 500 // in ms |
55 | 56 | , revoke = function(file) {
|
56 | 57 | var revoker = function() {
|
57 | 58 | if (typeof file === "string") { // file is an object URL
|
@@ -234,8 +235,8 @@ var saveAs = saveAs
|
234 | 235 | // while `this` is nsIContentFrameMessageManager
|
235 | 236 | // with an attribute `content` that corresponds to the window
|
236 | 237 |
|
237 |
| -if (typeof module !== "undefined" && module !== null) { |
238 |
| - module.exports = saveAs; |
| 238 | +if (typeof module !== "undefined" && module.exports) { |
| 239 | + module.exports.saveAs = saveAs; |
239 | 240 | } else if ((typeof define !== "undefined" && define !== null) && (define.amd != null)) {
|
240 | 241 | define([], function() {
|
241 | 242 | return saveAs;
|
|
0 commit comments