-
Notifications
You must be signed in to change notification settings - Fork 23
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
Unable to download bug on Safari #115
Comments
So indeed Firefox, Chrome OK The link is a button… <button class="button_link safari"
onclick="downloadFont('dev', this)"
tabindex="0"
contenteditable="false">
Download custom for dev
</button> Which is calling downloadFont {
// console.log("downloadFont")
// detect safari
const userAgentString = navigator.userAgent || "."
let usingChrome = userAgentString.indexOf("Chrome") > -1 || false
let usingSafari = userAgentString.indexOf("Safari") > -1 || false
if (usingChrome && usingSafari) usingSafari = false
// block download if from Safari since zip is corrupted
if (usingSafari) {
button.classList.remove("loaded", "error", "safari")
button.classList.add("loading")
setTimeout(() => {
button.classList.remove("loading")
button.classList.add("safari")
}, 500)
} else {
if (!downloadStarted) {
downloadStarted = true
button.classList.remove("loaded", "error", "safari")
button.classList.add("loading")
// cut for brevity
Promise.all(Object.values(allSettings).map((settings) => makeCustomFont(settings)))
.then((resolve) => getZipFileBlob(kindOfDownload, resolve))
.then((resolve) => initializeDownload(button, resolve))
.catch((error) => catchError(button, error))
}
}
} The reason in the comments for blocking Safari seems to be because the zip is corrupted. // block download if from Safari since zip is corrupted
if (usingSafari) {
button.classList.remove("loaded", "error", "safari")
button.classList.add("loading")
setTimeout(() => {
button.classList.remove("loading")
button.classList.add("safari")
}, 500) With a UA override to be chrome on Safari, for example, I get the confirm download window. It is downloading locally the zip file after choosing where I want to save it. Inside the folder. % ls -a1 ~/Downloads/CommitMonoV143
CommitMono-400-Italic.otf
CommitMono-400-Regular.otf
CommitMono-700-Italic.otf
CommitMono-700-Regular.otf
custom-settings.json
installation.txt
license.txt So maybe there was a reason in the past which is not valid anymore. And the UA sniffing could be removed. commit-mono/src/js/download_wizard.js Lines 30 to 37 in 696c044
|
I should have a look at this again, I should be able to get the ZIP on Safari to work. |
If you identify new troubles @eigilnikolajsen do not hesitate to contact me. |
confirmed on Orion (Version 0.99.130.2-beta (WebKit 621.1.2.111.4)) |
Steps to Reproduce
Download custom for dev
Expected Results
It should download without issue.
Actual Result
I get error and nothing gets logged in Web Console (Inspector) as well.
Just raising so this can be fixed.
If you need any help from WebKit side - please don't hesitate to raise bug on
bugs.webkit.org
.Thanks!
The text was updated successfully, but these errors were encountered: