emilk / ehttp

Minimal Rust HTTP client for both native and WASM
Apache License 2.0
323 stars 30 forks source link

Failed when using ehttp in web worker #60

Open xudesheng opened 3 months ago

xudesheng commented 3 months ago

I failed to use this crate to download a PDF file using a web worker.

The source code only works in the main thread since it needs to access the window object from web_sys.

let window = web_sys::window().unwrap();

Is it possible to support it in a web worker?