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

Modify prohibited syntax #760

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/FileSaver.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ var saveAs = _global.saveAs || (
}
} else {
// Support blobs
a.href = URL.createObjectURL(blob)
let binaryData = []
binaryData.push(blob)
a.href = URL.createObjectURL(new Blob(binaryData))
setTimeout(function () { URL.revokeObjectURL(a.href) }, 4E4) // 40s
setTimeout(function () { click(a) }, 0)
}
Expand Down Expand Up @@ -155,7 +157,9 @@ var saveAs = _global.saveAs || (
reader.readAsDataURL(blob)
} else {
var URL = _global.URL || _global.webkitURL
var url = URL.createObjectURL(blob)
let binaryData = []
binaryData.push(blob)
var url = URL.createObjectURL(new Blob(binaryData))
if (popup) popup.location = url
else location.href = url
popup = null // reverse-tabnabbing #460
Expand Down