Skip to content
Permalink
Browse files
chore: Rebuild dist
  • Loading branch information
rajivshah3 committed May 22, 2020
1 parent a60d75f commit 43bbd2f0ae6794f8d452cd360e9d33aef6071234
Showing with 9 additions and 7 deletions.
  1. +7 −5 dist/FileSaver.js
  2. +1 −1 dist/FileSaver.min.js
  3. +1 −1 dist/FileSaver.min.js.map
@@ -83,15 +83,17 @@
evt.initMouseEvent('click', true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null);
node.dispatchEvent(evt);
}
} // Detect WebKit inside a native macOS app
} // Detect WebView inside a native macOS app by ruling out all browsers
// We just need to check for 'Safari' because all other browsers (besides Firefox) include that too
// https://www.whatismybrowser.com/guides/the-latest-user-agent/macos


var isWebKit = /AppleWebKit/.test(navigator.userAgent);
var isMacOSWebView = /Macintosh/.test(navigator.userAgent) && /AppleWebKit/.test(navigator.userAgent) && !/Safari/.test(navigator.userAgent);
var saveAs = _global.saveAs || ( // probably in some web worker
typeof window !== 'object' || window !== _global ? function saveAs() {}
/* noop */
// Use download attribute first if possible (#193 Lumia mobile) unless this is a native macOS app
: 'download' in HTMLAnchorElement.prototype && !isWebKit ? function saveAs(blob, name, opts) {
// Use download attribute first if possible (#193 Lumia mobile) unless this is a macOS WebView
: 'download' in HTMLAnchorElement.prototype && !isMacOSWebView ? function saveAs(blob, name, opts) {
var URL = _global.URL || _global.webkitURL;
var a = document.createElement('a');
name = name || blob.name || 'download';
@@ -155,7 +157,7 @@

var isChromeIOS = /CriOS\/[\d]+/.test(navigator.userAgent);

if ((isChromeIOS || force && isSafari || isWebKit) && typeof FileReader !== 'undefined') {
if ((isChromeIOS || force && isSafari || isMacOSWebView) && typeof FileReader !== 'undefined') {
// Safari doesn't allow downloading of blob URLs
var reader = new FileReader();

Some generated files are not rendered by default. Learn more.

0 comments on commit 43bbd2f

Please sign in to comment.