Check that FileReader exists, not that it's an object

Fixes #576
This commit is contained in:
Chris Doble
2019-07-16 16:10:35 +10:00
parent a7e1ccfc44
commit b95a82a3ec
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -137,7 +137,7 @@ var saveAs = _global.saveAs || (
var isSafari = /constructor/i.test(_global.HTMLElement) || _global.safari
var isChromeIOS = /CriOS\/[\d]+/.test(navigator.userAgent)
if ((isChromeIOS || (force && isSafari)) && typeof FileReader === 'object') {
if ((isChromeIOS || (force && isSafari)) && typeof FileReader !== 'undefined') {
// Safari doesn't allow downloading of blob URLs
var reader = new FileReader()
reader.onloadend = function () {