Skip to content

Commit

Permalink
chore: Rebuild dist
Browse files Browse the repository at this point in the history
  • Loading branch information
rajivshah3 committed May 22, 2020
1 parent a60d75f commit 43bbd2f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
12 changes: 7 additions & 5 deletions dist/FileSaver.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion dist/FileSaver.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 43bbd2f

Please sign in to comment.