From ef70f923f7f13ea7e86ae672c693938bf4c176f9 Mon Sep 17 00:00:00 2001 From: OmedMilat <31986425+OmedMilat@users.noreply.github.com> Date: Mon, 25 Jan 2021 10:05:44 +0100 Subject: [PATCH] fix(FileSaver): HTMLAnchorElement is not defined (#3073) --- src/libs/FileSaver.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/FileSaver.js b/src/libs/FileSaver.js index 51a14bb8a..ad1d302d1 100644 --- a/src/libs/FileSaver.js +++ b/src/libs/FileSaver.js @@ -89,8 +89,8 @@ var saveAs = ? function saveAs() { /* noop */ } - : // Use download attribute first if possible (#193 Lumia mobile) - "download" in HTMLAnchorElement.prototype + : // Use download attribute first if possible (#193 Lumia mobile) unless this is a native app + (typeof HTMLAnchorElement !== "undefined" && "download" in HTMLAnchorElement.prototype) ? function saveAs(blob, name, opts) { var URL = _global.URL || _global.webkitURL; var a = document.createElement("a");