Skip to content

Commit ef70f92

Browse files
authored
fix(FileSaver): HTMLAnchorElement is not defined (#3073)
1 parent 63f89d4 commit ef70f92

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libs/FileSaver.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ var saveAs =
8989
? function saveAs() {
9090
/* noop */
9191
}
92-
: // Use download attribute first if possible (#193 Lumia mobile)
93-
"download" in HTMLAnchorElement.prototype
92+
: // Use download attribute first if possible (#193 Lumia mobile) unless this is a native app
93+
(typeof HTMLAnchorElement !== "undefined" && "download" in HTMLAnchorElement.prototype)
9494
? function saveAs(blob, name, opts) {
9595
var URL = _global.URL || _global.webkitURL;
9696
var a = document.createElement("a");

0 commit comments

Comments
 (0)