Closed e00E closed 5 days ago
There already is https://github.com/emilk/egui/issues/5293 and a PR https://github.com/emilk/egui/pull/5326 for this, so I'm closing this as a duplicate. This should be "fixed" in the next egui release (we will log a helpful error message and added a note to the docs).
This issue is out of egui's control. I'm creating it to help other people running into it when they search for the error message.
Description
When you try to use the clipboard in egui web app for example by selecting text and pressing ctrl-c to copy it, then you get an error in the console and the whole app freezes forever. This only happens if you access the site over http instead of https. On localhost like through
trunk serve
it does not happen either.In Firefox the error starts with this line:
In Chrome the error starts with this line:
Explanation
Egui since version.0.29.0 supports clipboard access on the web. In egui code this happens through
window.navigator().clipboard()
. As the MDN page warns:This is not reflected in this web-sys API, which causes a panic when the API is not available like in this case. The issue has been reported here https://github.com/rustwasm/wasm-bindgen/issues/4085 .