Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround for Windows phone 10 Edge bug (#193) #294

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion FileSaver.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var saveAs = saveAs || (function(view) {
}
, is_safari = /constructor/i.test(view.HTMLElement) || view.safari
, is_chrome_ios =/CriOS\/[\d]+/.test(navigator.userAgent)
, is_windows_phone_10 = /(Windows Phone 10.0;.*Edge)/.test(navigator.userAgent)
, throw_outside = function(ex) {
(view.setImmediate || view.setTimeout)(function() {
throw ex;
Expand Down Expand Up @@ -144,7 +145,8 @@ var saveAs = saveAs || (function(view) {
}
;
// IE 10+ (native saveAs)
if (typeof navigator !== "undefined" && navigator.msSaveOrOpenBlob) {
//Windows phone 10 has a known bug https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8153943/
if (typeof navigator !== "undefined" && navigator.msSaveOrOpenBlob && !is_windows_phone_10) {
return function(blob, name, no_auto_bom) {
name = name || blob.name || "download";

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

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

2 changes: 1 addition & 1 deletion demo/index.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</section>
<script async="" src="https://cdn.rawgit.com/eligrey/Blob.js/0cef2746414269b16834878a8abc52eb9d53e6bd/Blob.js"/>
<script async="" src="https://cdn.rawgit.com/eligrey/canvas-toBlob.js/f1a01896135ab378aa5c0118eadd81da55e698d8/canvas-toBlob.js"/>
<script async="" src="https://cdn.rawgit.com/eligrey/FileSaver.js/e9d941381475b5df8b7d7691013401e171014e89/FileSaver.min.js"/>
<script async="" src="../FileSaver.min.js"/>
<script async="" src="https://cdn.rawgit.com/eligrey/FileSaver.js/597b6cd0207ce408a6d34890b5b2826b13450714/demo/demo.js"/>
</body>
</html>