GoogleChromeLabs / browser-fs-access

File System Access API with legacy fallback in the browser
https://googlechromelabs.github.io/browser-fs-access/demo/
Apache License 2.0
1.38k stars 84 forks source link

it cannt work effectively on IOS Safari 15 #88

Closed shlroland closed 2 years ago

shlroland commented 2 years ago

its behavior is I can open the file picker,but when i finish the seleting work, the Promise cannt be fullfilled or rejected

tomayac commented 2 years ago

Sigh, we thought this was solved via #74 that closed #72, but currently the only way that seems to work reliably is what @dwelle has implemented for Excalidraw. Could you try this approach and come back with your results?

dwelle commented 2 years ago

Lemme know if you want me to port it from excal.

tomayac commented 2 years ago

I wonder if this has to do with HEIC images. For example, if I go to https://browser-fs-access.glitch.me/ and open an image from Photos on iOS Safari, it would never work. If I, however, open a .png from Files, it works perfectly fine, and so do .txt files. It also works fine for Excalidraw files, which may or may not have to do with @dwelle's approach.

I more and more suspect iOS has a HEIC problem, since the same code https://browser-fs-access.glitch.me/ works perfectly fine for image files I try on macOS Safari. Note that the input[accept] value is image/jpg,image/png,image/gif,image/webp,.jpg,.jpeg,.png,.gif,.webp, so not image/* and excluding .heic or any variant of image/heif, image/heic, image/heif-sequence, or image/heic-sequence. And yet Safari on iOS and macOS let me happily open .heic images.

dwelle commented 2 years ago

I don't recall, and I believe at the time I didn't have access to iOS so I was reproducing only on FF and MacOS Safari, and there it didn't work for .excalidraw/.json/.png files indiscriminately.