Skip to content

Commit 05df3e0

Browse files
committed
Closes eligrey#40 and eligrey#66
Also assuming navigator is defined from now on
1 parent 592034a commit 05df3e0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

FileSaver.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,15 @@
1414
/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
1515

1616
var saveAs = saveAs
17-
|| (typeof navigator !== "undefined" && navigator.msSaveOrOpenBlob && navigator.msSaveOrOpenBlob.bind(navigator))
17+
// IE 10+ (native saveAs)
18+
|| (navigator.msSaveOrOpenBlob && navigator.msSaveOrOpenBlob.bind(navigator))
19+
// Everyone else
1820
|| (function(view) {
1921
"use strict";
22+
// IE <10 is explicitly unsupported
23+
if (/MSIE [1-9]\./.test(navigator.userAgent)) {
24+
return;
25+
}
2026
var
2127
doc = view.document
2228
// only get URL when necessary in case BlobBuilder.js hasn't overridden it yet

0 commit comments

Comments
 (0)