News for hackers. Stuff that matters.
Re:Show HN: 4K Desktop Wallpaper Generator by peanut_worm on Sunday November 28, 2021 @09:12AM (#29369016)
You can’t download the image on iOS
Re:Show HN: 4K Desktop Wallpaper Generator by roytanck on Sunday November 28, 2021 @09:19AM (#29369064)
This unfortunately, is a known issue. I tried adding a download button, but that also only worked on desktop. Probably some browser policy thing. The same is true for Android (Chrome and Firefox Nightly).
Re:Show HN: 4K Desktop Wallpaper Generator by oefrha on Sunday November 28, 2021 @09:40AM (#29369237)
You can convert the canvas to a Blob with HTMLCanvasElement.toBlob(), then create a blob URL from that with URL.createObjectURL(). You can then replace the canvas with an <img src="blob://...">, which can be long press saved; add a download button linking to that blob URL; or whatever. Works on all non-ancient mobile browsers I've tested.

Do note that Firefox’s privacy.resistFingerprinting can block you from reading canvas image data, giving you garbage instead, and the permission prompt is basically unnoticeable if the user isn’t actively looking for it.

Re:Show HN: 4K Desktop Wallpaper Generator by roytanck on Monday November 29, 2021 @02:13AM (#29377242)
Thank you. I tried to implement this, but I got empty/missing images on mobile browsers. It basically worked everywhere where right-clicking also worked. I'll look into it more when I have more time.
Re:Show HN: 4K Desktop Wallpaper Generator by 58x14 on Sunday November 28, 2021 @12:43PM (#29370970)
I was able to download the image on iOS just now, using Firefox on iOS.
Re:Show HN: 4K Desktop Wallpaper Generator by 58x14 on Sunday November 28, 2021 @12:44PM (#29370981)
It showed up in my camera roll immediately, which seemed to ruin the joke until I read the explanation.