PolyMeilex / rfd

Rusty File Dialog
MIT License
566 stars 64 forks source link

Doesn't work in web workers #155

Open temeddix opened 11 months ago

temeddix commented 11 months ago

On wasm32 target, the file dialog doesn't work when exeucted from a web worker, not the main thread.

image

I think this problem needs a hand, because running Rust code in web workers is a common situation. Though window is not defined in web workers, there is still FileReader API that it is still possible to be used.

https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Functions_and_classes_available_to_workers https://developer.mozilla.org/en-US/docs/Web/API/FileReader