saljam / webwormhole

Peer authenticated WebRTC.
BSD 3-Clause "New" or "Revised" License
1.8k stars 91 forks source link

IOS 14.2 receiver prompts for download, get 189 byte file instead? #72

Closed lazerhawk closed 3 years ago

lazerhawk commented 3 years ago

Getting weird behavior, for a receiving browser on iOS 14.2 on an iPad, file download at start has a popup to download the file now, but that drops a 189 byte file, while the real download appears to continue on the page. When the real download completes, that file is not selectable for actual downloading.

Tried with Safari/Chrome/Firefox but same basic pattern.

Something break again?

saljam commented 3 years ago

thanks for reporting. i just upgraded an old iphone to ios 14 and can reproduce this.

we haven't changed anything on the webwormhole side for quite a while. maybe ios 14 made a breaking change in how it deals with downloads from service workers? i'll investigate this.

curiously, if i send a picture and tap on "show" instead of "download", it gets sent just fine.

saljam commented 3 years ago

ok, we've disabled service workers for safari a while back because they're not supported there for downloads. however, it seems like the method we used to detect safari (check window.safari) no longer works on ios 14.2.

i've updated the browser detection code with more heuristics (sigh) to detect it on ios. this is running on https://tip.webwormhole.io now and on https://webwormhole.io soon.

(i'm also puzzled as to why safari happily downloads an error message with status 404 as a file. oh, browsers...)